UNPKG

mcp-server-semgrep

Version:

MCP Server for Semgrep Integration - static code analysis with AI

49 lines (48 loc) 1.52 kB
rules: - id: pyramid-set-cookie-httponly-unsafe-value patterns: - pattern-either: - pattern-inside: | @pyramid.view.view_config(...) def $VIEW($REQUEST): ... $RESPONSE = $REQUEST.response ... - pattern-inside: | def $VIEW(...): ... $RESPONSE = pyramid.httpexceptions.HTTPFound(...) ... - pattern-not: $RESPONSE.set_cookie(..., **$PARAMS) - pattern: $RESPONSE.set_cookie(..., httponly=$HTTPONLY, ...) - pattern: $HTTPONLY - metavariable-pattern: metavariable: $HTTPONLY pattern: | False fix: | True message: >- Found a Pyramid cookie without the httponly option correctly set. Pyramid cookies should be handled securely by setting httponly=True in response.set_cookie(...). If this parameter is not properly set, your cookies are not properly protected and are at risk of being stolen by an attacker. metadata: cwe: - "CWE-1004: Sensitive Cookie Without 'HttpOnly' Flag" owasp: - A05:2021 - Security Misconfiguration references: - https://owasp.org/www-community/controls/SecureCookieAttribute - https://owasp.org/www-community/HttpOnly - https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html#httponly-attribute category: security technology: - pyramid subcategory: - vuln likelihood: LOW impact: LOW confidence: MEDIUM languages: [python] severity: WARNING