Skip to content

[Bounty proposal] security(shipbob-app): script-context breakout in uid and unescaped auth error reflection (5 proposed) #15014

Closed as not planned

Description

@kaleidoscopeAI

Summary

In plugins/omi-shipbob-app/, the setup page and OAuth callback contain script-context breakout and reflected error vulnerabilities:

  1. Inline <script> Context Breakout in setup.html:
    In plugins/omi-shipbob-app/templates/setup.html line 410:

    <script>
        function updateChannel(channelId) {
            fetch('/select-channel', {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json'
                },
                body: JSON.stringify({
                    uid: '{{ uid }}',
                    channel_id: channelId
                })
            }).then(response => {

    uid: '{{ uid }}' interpolates uid directly inside a JavaScript string literal in an inline <script>.

    • Single quotes in uid break out into JavaScript execution syntax: ' + alert(1) + '.
    • </script> in uid terminates the script element in the HTML parser, allowing closing script tags and arbitrary injected HTML/scripts to execute (</script><script>alert(document.domain)</script>).
  2. Attribute Breakout in Disconnect and Auth Links:
    Lines 398 and 458 in setup.html:

    <a href="/disconnect?uid={{ uid }}" class="btn btn-danger btn-small">
    <a href="/auth/shipbob?uid={{ uid }}" class="btn btn-shipbob">

    uid is interpolated raw without URL encoding (quote(uid, safe='')), leading to attribute breakout or query parameter corruption.

  3. Unescaped Upstream Response Text in Callback:
    In plugins/omi-shipbob-app/main.py line 545:

    "error": f"Failed to exchange authorization code: {response.text}",

    Upstream error response text is reflected directly into the template error container.

Proposed Fix

  1. In plugins/omi-shipbob-app/main.py, serialize uid using json.dumps(str(uid)).replace("</", "<\\/") and pass safe_uid_json to setup.html to be rendered safely as uid: {{ safe_uid_json|safe }} without quotes.
  2. In plugins/omi-shipbob-app/main.py, canonicalize clean_uid with validation/sanitization and URL-encode safe_uid_param = quote(uid, safe='') for href links.
  3. Escape response.text in callback failure handling via html.escape(response.text).
  4. Add unit test suite in plugins/omi-shipbob-app/test_shipbob_security.py verifying script-context breakout prevention, quote breakout prevention, and attribute escaping.
  5. Register shipbob-app-security-tests in .github/checks-manifest.yaml.

Proposed Bounty

$75 proposed (consistent with security hardening bounties #14876, #14886, #14888, #14994, #15004, and #15011). PR with full test suite is ready to submit.

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 #15014

    Fixed and verified in PR #15015.
    Payment details:

  3. added
    intelligence
    p2
    retrieval-action
    and removed
    intelligence
    p2
    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