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
- [Check Point Research – ZipLine Campaign: A Sophisticated Phishing Attack Targeting US Companies](https://research.checkpoint.com/2025/zipline-phishing-campaign/)
Abuse discrepancies between browser and server parsing by prepending a Unicode whitespace code point to the cookie name. The browser won’t consider the name to literally start with `__Host-`/`__Secure-`, so it allows setting from a subdomain. If the backend trims/normalizes leading Unicode whitespace on cookie keys, it will see the protected name and may overwrite the high-privilege cookie.
114
+
115
+
- PoC from a subdomain that can set parent-domain cookies:
- Typical backend behavior that enables the issue:
122
+
- Frameworks that trim/normalize cookie keys. In Django, Python’s `str.strip()` removes a wide range of Unicode whitespace code points, causing the name to normalize to `__Host-name`.
- Many frameworks resolve duplicate cookie names as “last wins”, so the attacker-controlled normalized cookie value overwrites the legitimate one.
125
+
126
+
- Browser differences matter:
127
+
- Safari blocks multibyte Unicode whitespace in cookie names (e.g., rejects U+2000) but still permits single-byte U+0085 and U+00A0, which many backends trim. Cross-test across browsers.
128
+
129
+
- Impact: Enables overwriting of `__Host-`/`__Secure-` cookies from less-trusted contexts (subdomains), which can lead to XSS (if reflected), CSRF token override, and session fixation.
130
+
131
+
- On-the-wire vs server view example (U+2000 present in name):
Many backends split/parse and then trim, resulting in the normalized `__Host-name` taking the attacker’s value.
138
+
139
+
#### Legacy `$Version=1` cookie splitting on Java backends (prefix bypass)
140
+
141
+
Some Java stacks (e.g., Tomcat/Jetty-style) still enable legacy RFC 2109/2965 parsing when the `Cookie` header starts with `$Version=1`. This can cause the server to reinterpret a single cookie string as multiple logical cookies and accept a forged `__Host-` entry that was originally set from a subdomain or even over insecure origin.
- Client-side prefix checks apply during set, but server-side legacy parsing later splits and normalizes the header, bypassing the intent of `__Host-`/`__Secure-` prefix guarantees.
151
+
152
+
- Where to try: Tomcat, Jetty, Undertow, or frameworks that still honor RFC 2109/2965 attributes. Combine with duplicate-name overwrite semantics.
153
+
154
+
#### Duplicate-name last-wins overwrite primitive
155
+
156
+
When two cookies normalize to the same name, many backends (including Django) use the last occurrence. After smuggling/legacy-splitting produces two `__Host-*` names, the attacker-controlled one will typically win.
157
+
158
+
#### Detection and tooling
159
+
160
+
Use Burp Suite to probe for these conditions:
161
+
162
+
- Try multiple leading Unicode whitespace code points: U+2000, U+0085, U+00A0 and observe whether the backend trims and treats the name as prefixed.
163
+
- Send `$Version=1` first in the Cookie header and check if the backend performs legacy splitting/normalization.
164
+
- Observe duplicate-name resolution (first vs last wins) by injecting two cookies that normalize to the same name.
165
+
- Burp Custom Action to automate this: [CookiePrefixBypass.bambda](https://github.com/PortSwigger/bambdas/blob/main/CustomAction/CookiePrefixBypass.bambda)
166
+
167
+
> Tip: These techniques exploit RFC 6265’s octet-vs-string gap: browsers send bytes; servers decode and may normalize/trim. Mismatches in decoding and normalization are the core of the bypass.
168
+
110
169
## Cookies Attacks
111
170
112
171
If a custom cookie contains sensitive data check it (specially if you are playing a CTF), as it might be vulnerable.
@@ -339,6 +398,8 @@ There should be a pattern (with the size of a used block). So, knowing how are a
-[Cookie Chaos: How to bypass __Host and __Secure cookie prefixes](https://portswigger.net/research/cookie-chaos-how-to-bypass-host-and-secure-cookie-prefixes)
0 commit comments