UNPKG

mcp-server-semgrep

Version:

MCP Server for Semgrep Integration - static code analysis with AI

40 lines (39 loc) 1.05 kB
rules: - id: session-cookie-missing-httponly patterns: - pattern-not-inside: | &sessions.Options{ ..., HttpOnly: true, ..., } - pattern: | &sessions.Options{ ..., } message: >- A session cookie was detected without setting the 'HttpOnly' flag. The 'HttpOnly' flag for cookies instructs the browser to forbid client-side scripts from reading the cookie which mitigates XSS attacks. Set the 'HttpOnly' flag by setting 'HttpOnly' to 'true' in the Options struct. metadata: cwe: - "CWE-1004: Sensitive Cookie Without 'HttpOnly' Flag" owasp: - A05:2021 - Security Misconfiguration references: - https://github.com/0c34/govwa/blob/139693e56406b5684d2a6ae22c0af90717e149b8/user/session/session.go#L69 category: security technology: - gorilla confidence: MEDIUM subcategory: - audit likelihood: LOW impact: LOW fix-regex: regex: (HttpOnly\s*:\s+)false replacement: \1true severity: WARNING languages: [go]