Skip to content

Security: Reflected/stored XSS via unsanitized HTML interpolation in search results#445

Open
tuanaiseo wants to merge 1 commit intoarakoodev:tsfrom
tuanaiseo:contribai/fix/security/reflected-stored-xss-via-unsanitized-htm
Open

Security: Reflected/stored XSS via unsanitized HTML interpolation in search results#445
tuanaiseo wants to merge 1 commit intoarakoodev:tsfrom
tuanaiseo:contribai/fix/security/reflected-stored-xss-via-unsanitized-htm

Conversation

@tuanaiseo
Copy link
Copy Markdown

Problem

User-controlled and model-controlled values are directly interpolated into HTML (final_answer, rawText, metadata, filename, titleMetadata, documentDate) and returned with c.html(...) without output encoding. An attacker can inject <script> or event-handler payloads through query inputs or upstream content and execute JavaScript in victim browsers.

Severity: high
File: JS/edgechains/lib/create-edgechains/__common/src/routes/hydeSearch.route.ts

Solution

HTML-escape all dynamic fields before interpolation, or render using a templating system with auto-escaping. Additionally apply a strict CSP and avoid returning raw concatenated HTML strings.

Changes

  • JS/edgechains/lib/create-edgechains/__common/src/routes/hydeSearch.route.ts (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

User-controlled and model-controlled values are directly interpolated into HTML (`final_answer`, `rawText`, `metadata`, `filename`, `titleMetadata`, `documentDate`) and returned with `c.html(...)` without output encoding. An attacker can inject `<script>` or event-handler payloads through query inputs or upstream content and execute JavaScript in victim browsers.

Affected files: hydeSearch.route.ts

Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 7, 2026

CLA Assistant Lite bot: Thank you for your submission, we really appreciate it. Before we can accept your contribution, we ask that you sign the Arakoo Contributor License Agreement. You can sign the CLA by adding a new comment to this pull request and pasting exactly the following text.


I have read the Arakoo CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant