missing origin/source check on store.steampowered.com cache-invalidation postMessage listener
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 88/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript
- Ambito
- security
Direzione di ricerca
Inizia da scripts/store/invalidate_cache.js:17-29 e confronta il relativo listener dei messaggi con quello di scripts/steamdb/global.js:25-30. Verifica il sender esistente di MAIN-world ed esegui i check pertinenti dell’estensione oppure un test mirato di message-event. Il lavoro è completo quando i messaggi provenienti da un origin o da una source esterni non attivano più l’invalidazione della cache, mentre i messaggi della stessa finestra continuano a farlo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
scripts/store/invalidate_cache.js listens for window "message" events and, on receiving { type: 'steamdb:extension-invalidate-cache' }, forwards a privileged InvalidateCache request to the background service worker with no check on event.origin or event.source. Any foreign origin can window.open() a store.steampowered.com tab and postMessage() this trigger directly, wiping the extension's cached Steam user/library/family data.
The near-identical listener on steamdb.info (scripts/steamdb/global.js:25-30) correctly checks request.origin !== window.location.origin -- this copy of the same feature just forgot it.
Root cause
// scripts/store/invalidate_cache.js:17-29
window.addEventListener( 'message', ( request ) =>
{
if( request?.data && request.data.type === 'steamdb:extension-invalidate-cache' )
{
SendMessageToBackgroundScript( { contentScriptQuery: 'InvalidateCache' }, () => {} );
}
} );
No origin/source check. store.steampowered.com sets frame-ancestors 'none' (can't be iframed) but no Cross-Origin-Opener-Policy, so a window.open() popup retains a scriptable cross-origin opener relationship -- enough to reach this listener.
Proof of concept (live-verified)
Loaded the real unpacked extension in Chrome via Puppeteer/CDP, mapping store.steampowered.com and an unrelated attacker.example to local fixtures, observed the real background service worker's chrome.storage.local:
// on https://attacker.example/
window.__popup = window.open('https://store.steampowered.com/', 'victim');
window.__popup.postMessage({ type: 'steamdb:extension-invalidate-cache' }, '*');
BEFORE: {"userdata.cached":111111,"userfamilydata":"{\"seed\":true}"}
AFTER: {"userdata.cached":1789393938791,"userfamilydata":"{}"}
CACHE WAS INVALIDATED BY FORGED CROSS-ORIGIN MESSAGE
Impact
Low: only reachable privileged action is InvalidateCache() -- forces re-fetch of the user's own dynamicstore/userdata endpoint, minor nuisance DoS + transient loss of "already owned" highlighting. No data exfiltration (fetch targets Steam's own endpoint with credentials, response never reaches the attacker). No other contentScriptQuery is reachable through this listener.
Suggested fix
window.addEventListener( 'message', ( request ) =>
{
if( request.source !== window || request.origin !== window.location.origin )
{
return;
}
if( request?.data && request.data.type === 'steamdb:extension-invalidate-cache' )
{
...
Mirrors the already-correct pattern in scripts/steamdb/global.js; the MAIN-world sender already targets window.location.origin explicitly, so this has no functional downside.
This report was produced with AI assistance (Claude, Anthropic): manifest review, source tracing, and a live end-to-end Puppeteer/CDP proof-of-concept against the real unpacked extension.
- Lingua principale
- JavaScript
- Stelle
- 1.2k
- Fork
- 96
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di SteamDatabase/BrowserExtension
-
Не работает Быстрая Продажа Apertabug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
SteamDatabase/BrowserExtension#279 · 1 commento · 3 reazioni ·
-
enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
-
enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
Tutte le issue di SteamDatabase/BrowserExtension
Issue simili
-
Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Automattic/safe-publish#594 ·
-
内部文件键(绝对路径的 base64)泄漏到界面标签 Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
dream-num/dsh-univer-office#104 ·
-
comp/dashboard invalid P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
NousResearch/hermes-agent#121143 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
avniproject/avni-webapp#1811 ·
-
area/auroraboot area/webui bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100