Skip to content

CSRF origin check disabled in Pyramid config

Description

CSRF protection is disabled by setting check_origin=False. This allows an attacker to perform Cross-Site Request Forgery attacks, potentially leading to unauthorized actions on behalf of the user.

Examples

Insecure Code

python
CONFIG.set_default_csrf_options(check_origin=False)

Secure Code

python
CONFIG.set_default_csrf_options(check_origin=True)

Remediation

Set check_origin=True to enforce origin checking for all unsafe methods.

Rule Details

FieldValue
IDCODE-0810
CategoryWeb
SeverityMEDIUM
CWECWE-352
ConfidenceHIGH
ImpactMEDIUM
LikelihoodMEDIUM
ExploitabilityEASY
TagsCSRF, security
OWASPA01:2021-Broken Access Control