Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update download URL to include a HTTP redirect in spoof-js-download-url #175

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions security/address-bar-spoofing/spoof-js-download-url.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,20 @@
function run() {
const w = open()
w.opener = null
w.document.write('<h1>Not Third Party Site.</h1>')
w.location = 'https://bad.third-party.site/features/download/file/pdf'
w.document.write('<h1>Not DDG.</h1>')
w.location = 'https://tyny.to/s509a8'
}
</script>
</head>

<body>
<p><a href="./index.html">[Back]</a></p>
This test uses a download URL for downloading a file to spoof the browser into displaying the download
URL as the current origin while rewriting the document content to spoof the address bar.
This test uses a download URL that performs a HTTP redirect for downloading a file to trick the
browser into displaying the download URL as the current origin while rewriting the document content
resulting in a spoofed address bar.
The expected result is that the redirect should be followed and the file should be downloaded
in the about:blank context instead of in the context of the download URL where the document might
be spoofed by the previous page.
<button onclick="run()">Start</button>
</body>

Expand Down
Loading