UNPKG

mcp-server-semgrep

Version:

MCP Server for Semgrep Integration - static code analysis with AI

44 lines (43 loc) 1.35 kB
rules: - id: pyramid-set-cookie-httponly-unsafe-default 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(..., httponly=$HTTPONLY, ...) - pattern-not: $RESPONSE.set_cookie(..., **$PARAMS) - pattern: $RESPONSE.set_cookie(...) fix-regex: regex: (.*)\) replacement: \1, httponly=True) message: >- Found a Pyramid cookie using an unsafe default for the httponly option. 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 category: security technology: - pyramid references: - https://owasp.org/Top10/A05_2021-Security_Misconfiguration subcategory: - vuln likelihood: LOW impact: LOW confidence: MEDIUM languages: [python] severity: WARNING