Widget code hardcodes the old ChatGPT sandbox origin: fix before December 15
Do not compare against web-sandbox.oaiusercontent.com or the old derived origin. After the migration the origin is derived from your MCP URL.
Remove literal widget sandbox hostnames from your widget code. The rule apps.hardcoded-widget-origin is a major finding for ChatGPT. It fails when the template HTML contains a host ending in oaiusercontent.com that is not already in the new mcp-endpoint-<hash> form.
What you see
- A scan reports
HTML references web-sandbox.oaiusercontent.comor a hostname derived from your old widget domain. - After the migration, origin checks or allowlists that match the old host stop matching. The exact symptom depends on your code and is not verified here.
Why it happens
OpenAI's widget origin migration guide says the widget subdomain "will be derived from your configured MCP server URL, using a deterministic hash" instead of from your declared domain. The new format is https://mcp-endpoint-<first 32 hex chars of SHA-256 of the MCP server URL>.web-sandbox.oaiusercontent.com, and the URL is hashed exactly as written, so a trailing slash or query string gives a different origin. The guide sets a deadline of December 15.
Code that compares event.origin or document.referrer to a literal host, or builds that host from your domain, breaks.
Check it yourself
curl -s -X POST https://mcp.acme.example/mcp \
-H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \
-H "Authorization: Bearer $TOKEN" \
-d '{"jsonrpc":"2.0","id":1,"method":"resources/read","params":{"uri":"ui://widget/orders.html"}}' \
| jq -r '.result.contents[0].text' | grep -o '[A-Za-z0-9.-]*oaiusercontent\.com'
printf %s 'https://mcp.acme.example/mcp' | shasum -a 256 | cut -c1-32
The second command shows the hash part of the new origin for your exact URL.
Fix
- Delete comparisons against the old host. Do not replace them with the new literal.
- Verify the sender through the MCP Apps bridge your SDK provides, rather than checking an origin string. The migration guide does not name
event.origin, so check how your message handling works. - Add the new origin to API CORS allowlists,
frame-ancestorsheaders and third-party referrer settings, and keep the old one until migration completes (apps.origin-migration). - Make the widget start with empty browser storage, because
localStorageand IndexedDB do not carry over.
Verify
The grep finds no old host, the widget works in ChatGPT, then re-scan.
Which clients care
ChatGPT, per the rule.
Source
Widget origin migration: https://developers.openai.com/plugins/guides/widget-origin-migration
Run a free scan at https://mcpshipyard.com/scan to check every rule at once.
Check every rule at once
A free scan runs this check and the other 152 against your live URL.