[Bounty proposal] security(shipbob-app): script-context breakout in uid and unescaped auth error reflection (5 proposed)
Summary
In plugins/omi-shipbob-app/, the setup page and OAuth callback contain script-context breakout and reflected error vulnerabilities:
-
Inline
<script>Context Breakout insetup.html: Inplugins/omi-shipbob-app/templates/setup.htmlline 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 }}'interpolatesuiddirectly inside a JavaScript string literal in an inline<script>.- Single quotes in
uidbreak out into JavaScript execution syntax:' + alert(1) + '. </script>inuidterminates the script element in the HTML parser, allowing closing script tags and arbitrary injected HTML/scripts to execute (</script><script>alert(document.domain)</script>).
- Single quotes in
-
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">uidis interpolated raw without URL encoding (quote(uid, safe='')), leading to attribute breakout or query parameter corruption. -
Unescaped Upstream Response Text in Callback: In
plugins/omi-shipbob-app/main.pyline 545:"error": f"Failed to exchange authorization code: {response.text}",Upstream error response text is reflected directly into the template error container.
Proposed Fix
- In
plugins/omi-shipbob-app/main.py, serializeuidusingjson.dumps(str(uid)).replace("</", "<\\/")and passsafe_uid_jsontosetup.htmlto be rendered safely asuid: {{ safe_uid_json|safe }}without quotes. - In
plugins/omi-shipbob-app/main.py, canonicalizeclean_uidwith validation/sanitization and URL-encodesafe_uid_param = quote(uid, safe='')for href links. - Escape
response.textin callback failure handling viahtml.escape(response.text). - Add unit test suite in
plugins/omi-shipbob-app/test_shipbob_security.pyverifying script-context breakout prevention, quote breakout prevention, and attribute escaping. - Register
shipbob-app-security-testsin.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.
/claim #15014
Fixed and verified in PR #15015. Payment details:
- Instant Stripe Payment Link: https://buy.stripe.com/4gMeVdfUYg0Q7oE39LcbC0F
- PayPal / Payout Email:
[email protected]
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! 🙏