In-browser messaging
25Browser messaging changes the transport, not the trust rules. A wildcard recipient or unchecked sender can leak or inject a response.
Keep transaction binding and the rest of § 2.1 protections in place.
Key idea: Verify both ends of the browser message.
Rules & examples
Verify both ends of the browser message.
- Servers MUST exactly match pre-registered receiver origins and send only to trusted client origins. Wildcard target origins MUST NOT be used.
- Clients MUST exactly compare the sender origin to the expected authorization-server origin to prevent injection.
- All authorization-response protections in § 2.1 still apply to these communication flows.
The RFC covers three failures: wildcard receivers, insufficient receiver-URI validation, and missing sender-origin checks. A string that merely contains a trusted domain is not an exact origin match.
Sources
New to this? Start hereA quick picture + helpful background
A key is different from permission.
An app, a person, and a server have different roles. Follow who asks, who grants permission, and who checks the credential. A key in the drawing is an analogy, not a literal protocol field.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
In-browser response transports must use exact trusted receiver and sender origins. Wildcard postMessage recipients are prohibited.
Read the updated RFC section ↗