Skip to content

Commit 463ea8f

Browse files
authored
docs: expand cookie_http_only documentation with security warnings (#1894)
* feat: add llms.txt to allow LLM consumption of docs This adds a llms.txt file to the root of the documentation repository. This file explicitly grants permission for Large Language Models (LLMs) to ingest and use Pomerium's public documentation. Fixes #1862 * docs: expand cookie_http_only documentation with security warnings Add comprehensive security warnings to the cookie_http_only documentation to help users understand the risks of disabling HttpOnly cookies: - Document XSS vulnerabilities when HttpOnly is disabled - Add warnings about client-side attacks and third-party script risks - Include security warning box with best practices - Provide guidance for users who must disable HttpOnly Fixes #1877 * fix: correct admonition formatting and remove llms.txt - Fix admonition block formatting by adding required blank line after warning header - Remove llms.txt file as requested - Apply prettier formatting to ensure consistency * Update content/docs/reference/cookies.mdx * style: clean up formatting in cookie_http_only admonition - Remove trailing whitespace - Remove extra blank line after admonition block - Ensure consistent formatting throughout the file
1 parent 1b1b97b commit 463ea8f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

content/docs/reference/cookies.mdx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,26 @@ cookie:
162162

163163
If true, **Cookie HTTP Only** forbids JavaScript from accessing the cookie.
164164

165+
While the HttpOnly flag is enabled by default for security reasons, some users may choose to disable it for specific use cases that require JavaScript access to cookies. However, disabling HttpOnly cookies significantly increases security risks:
166+
167+
- **XSS Vulnerability**: Without the HttpOnly flag, cookies become accessible to JavaScript code, making them vulnerable to Cross-Site Scripting (XSS) attacks. Malicious scripts could steal session cookies and hijack user sessions.
168+
- **Client-Side Attacks**: Any compromised or malicious JavaScript running on the page can read and exfiltrate cookie values.
169+
- **Third-Party Script Risks**: If your application includes third-party JavaScript libraries or scripts, they would also have access to non-HttpOnly cookies.
170+
171+
:::warning Security Warning
172+
173+
Disabling the HttpOnly flag (`cookie_http_only: false`) is strongly discouraged and should only be done when absolutely necessary. If you must disable HttpOnly:
174+
175+
1. Ensure your application has robust XSS protection mechanisms
176+
2. Regularly audit all JavaScript code, including third-party dependencies
177+
3. Consider implementing additional security measures like Content Security Policy (CSP)
178+
4. Limit the scope and lifetime of non-HttpOnly cookies
179+
5. Monitor for suspicious activity that could indicate cookie theft
180+
181+
The security implications of disabling HttpOnly far outweigh most convenience benefits. Carefully evaluate whether your use case truly requires JavaScript cookie access before making this change.
182+
183+
:::
184+
165185
### How to configure {#cookie-http-only-how-to-configure}
166186

167187
<Tabs>

0 commit comments

Comments
 (0)