You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pentesting-web/ssrf-server-side-request-forgery/url-format-bypass.md
+36Lines changed: 36 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -217,10 +217,46 @@ The “left square bracket” character `[` in the userinfo segment can cause Sp
217
217
218
218
image from [https://claroty.com/2022/01/10/blog-research-exploiting-url-parsing-confusion/](https://claroty.com/2022/01/10/blog-research-exploiting-url-parsing-confusion/)
219
219
220
+
### IPv6 Zone Identifier (%25) Trick
221
+
222
+
Modern URL parsers that support RFC 6874 allow *link-local* IPv6 addresses to include a **zone identifier** after a percent sign. Some security filters are not aware of this syntax and will only strip square-bracketed IPv6 literals, letting the following payload reach an internal interface:
223
+
224
+
```text
225
+
http://[fe80::1%25eth0]/ # %25 = encoded '%', interpreted as fe80::1%eth0
226
+
http://[fe80::a9ff:fe00:1%25en0]/ # Another example (macOS style)
227
+
```
228
+
229
+
If the target application validates that the host is *not*`fe80::1` but stops parsing at the `%`, it may incorrectly treat the request as external. Always normalise the address **before** any security decision or strip the optional zone id entirely.
230
+
231
+
### Recent Library Parsing CVEs (2022–2025)
232
+
233
+
A number of mainstream frameworks have suffered from hostname-mismatch issues that can be exploited for SSRF once URL validation has been bypassed with the tricks listed above:
| 2024 |CVE-2024-22243 / ‑22262 | Spring `UriComponentsBuilder`|`[` is not allowed in the *userinfo* section, so `https://example.com\[@internal` is parsed as host `example.com` by Spring but as `internal` by browsers, enabling open-redirect & SSRF when host allow-lists are used. Upgrade to Spring 5.3.34 / 6.0.19 / 6.1.6+. |
238
+
| 2023 |CVE-2023-27592 |**urllib3** <1.26.15 | Backslash confusion allowed `http://example.com\\@169.254.169.254/` to bypass host filters that split on `@`. |
239
+
| 2022 |CVE-2022-3602 | OpenSSL | Hostname verification skipped when the name is suffixed with a `.` (dotless ___domain confusion). |
240
+
241
+
When you depend on third-party URL parsers, **compare the canonicalised host returned by the library you trust with the raw string supplied by the user** to detect these classes of issues.
242
+
243
+
### Payload-generation helpers (2024+)
244
+
245
+
Creating large custom word-lists by hand is cumbersome. The open-source tool **SSRF-PayloadMaker** (Python 3) can now generate *80 k+* host-mangling combinations automatically, including mixed encodings, forced-HTTP downgrade and backslash variants:
246
+
247
+
```bash
248
+
# Generate every known bypass that transforms the allowed host example.com to attacker.com
249
+
python3 ssrf_maker.py --allowed example.com --attacker attacker.com -A -o payloads.txt
250
+
```
251
+
252
+
The resulting list can be fed directly into Burp Intruder or `ffuf`.
0 commit comments