Stealing Passwords via HTML Injection Under a Strict CSP#2313
Open
carlospolop wants to merge 1 commit into
Open
Stealing Passwords via HTML Injection Under a Strict CSP#2313carlospolop wants to merge 1 commit into
carlospolop wants to merge 1 commit into
Conversation
Collaborator
Author
🔗 Additional ContextOriginal Blog Post: https://afine.com/blogs/stealing-passwords-via-html-injection-under-a-strict-csp Content Categories: Based on the analysis, this content was categorized under "Pentesting Web -> Content Security Policy (CSP) Bypass, or Pentesting Web -> XSS / HTML Injection techniques". Repository Maintenance:
Review Notes:
Bot Version: HackTricks News Bot v1.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Automated Content Update
This PR was automatically generated by the HackTricks News Bot based on a technical blog post.
📝 Source Information
🎯 Content Summary
The post explains a practical credential-theft chain where reflected HTML injection is enough to steal passwords saved in a browser password manager, even when a very strict
Content-Security-Policymakes JavaScript execution impossible. The attack abuses four behaviors together: attacker-controlled HTML is reflected into a trusted origin; the browser password manager autofills an injected login form; the injected form submits credentials with the defaultGETm...🔧 Technical Details
HTML injection can weaponize browser password autofill without JavaScript. If attacker-controlled HTML is reflected into a trusted origin where the victim has saved credentials, the attacker can inject a fake login form with fields such as
<input type=email name=email>and<input type=password name=password>. Browser password managers may autofill those fields because the form is rendered on the legitimate site. If the form omitsmethod, it defaults toGET, causing the autofilled password to be appended to the URL as a query parameter after submission.Strict CSP does not eliminate HTML-only exfiltration chains. A CSP like
default-src 'none'; script-src 'none'; style-src 'none'; img-src 'none'; connect-src 'none'; frame-src 'none'; form-action 'self'blocks scripts, images, fetch, frames, and external form submissions, but it does not necessarily stop injected forms or<meta htt...🤖 Agent ActionsDone.
Updated:
src/pentesting-web/content-security-policy-csp-bypass/README.mdAdded:
GETform submission putting credentials in the URL<meta name="referrer" content="unsafe-url"><meta http-equiv="Refresh">Also updated the file’s References section with:
Referrer-PolicydocsI kept the change in a single existing file to avoid duplication.
This PR was automatically created by the HackTricks Feed Bot. Please review the changes carefully before merging.