Skip to content

[Bounty proposal] security(iq-rating): script-context breakout in uid and people_data, unescaped exception reflection (5 proposed) #15004

Closed as not planned

Description

@kaleidoscopeAI

Summary

plugins/iq_rating/main.py contains inline script context breakouts and unescaped exception reflection on GET /iq-rating/iq:

  1. Script Context Breakout in Inline uid Variable (GET /iq-rating/iq?uid=...):

    • In PEOPLE_LIST_CONTENT (line 1563):
      <script>
          const uid = '{uid}';
    • In iq_rating_page(uid) (line 1730):
      content = PEOPLE_LIST_CONTENT.format(uid=uid, people_data_json=people_json, total_people=len(people_with_iq))
    • If uid contains '; alert(1); // or </script><script>alert(1)</script>, it breaks out of the JavaScript string literal or closes the HTML <script> element, executing arbitrary JavaScript.
  2. Inline Script Breakout in peopleData JSON Serialization:

    • In line 1564:
      let peopleData = {people_data_json};
    • In line 1729:
      people_json = json.dumps(people_with_iq)
    • Python's standard json.dumps() does not escape the solidus (/), so strings containing </script> (e.g. within person names, memory transcripts, or nicknames) terminate the enclosing <script> tag and trigger HTML/JS injection.
  3. Reflected Exception Message in Error Content:

    • In line 1736:
      except Exception as e:
          error_content = f'<div class="empty-state"><h2>Error</h2><p>{str(e)}</p></div>'
    • Unhandled exception messages are interpolated raw into the HTML error response without html.escape().

Proposed Fix

  1. Serialize uid via safe_uid_json = json.dumps(str(uid)).replace('</', '<\\/') and render const uid = {uid_json}; without enclosing single quotes.
  2. Escape closing script tags in people_json via .replace('</', '<\\/').
  3. Wrap exception string formatting with html.escape(str(e)).
  4. Add a hermetic unit test suite in plugins/iq_rating/test_iq_rating_security.py verifying script context breakout prevention, </script> sanitization in uid and people_data, and exception escaping.
  5. Register the new test suite in .github/checks-manifest.yaml.

Proposed Bounty

@kodjima33 @josancamon19 — under the contribution guide's bounty-suggestion process, would you approve a US$75 bounty, payable upon review and merge?
PR with hermetic tests is ready.

Activity

  1. moved this from Someday to In progress in omi TODO / bountieson Sep 19, 2026
  2. kaleidoscopeAI commented on Sep 19, 2026

    @kaleidoscopeAI
    ContributorAuthor

    /claim #15004

    Fixed and verified in PR #15008.
    Payment details:

  3. added
    capture
    p1
    retrieval-action
    p2
    and removed
    capture
    p1
    on Oct 6, 2026
  4. undivisible commented on Oct 22, 2026

    @undivisible
    Collaborator

    Thanks for putting this together. We aren't doing bounties at the moment, so we're closing the bounty proposal issues for now — thanks for the fix! 🙏

  5. moved this from In progress to In review in omi TODO / bountieson Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    p2retrieval-action

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions