omi icon indicating copy to clipboard operation
omi copied to clipboard

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

Open kaleidoscopeAI opened this issue 2 months ago • 2 comments

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.

kaleidoscopeAI avatar Sep 19 '26 17:09 kaleidoscopeAI

/claim #15014

Fixed and verified in PR #15015. Payment details:

  • Instant Stripe Payment Link: https://buy.stripe.com/4gMeVdfUYg0Q7oE39LcbC0F
  • PayPal / Payout Email: [email protected]

kaleidoscopeAI avatar Sep 19 '26 17:09 kaleidoscopeAI

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! 🙏

undivisible avatar Oct 22 '26 11:10 undivisible