Skip to content
vetkitChecksChangelogDocumentation

vetkit.py.auth.assert-authorization

An authorization check is written as an assert statement. Python removes asserts when run with -O, which silently disables the check.

Last updated:

Suite: Security

python

An authorization check is written as an assert statement. Python removes asserts when run with -O, which silently disables the check.

Category: SECURITY · Engine rule severity: WARNING

How to fix it

Use an explicit if-check that raises PermissionDenied / returns 403.

References

Source: packages/engine/rules/sast/python.yml.

Generated from shipped rule definitions at build time. Matching is a review signal, not proof of exploitability. “generic” denotes text matching, not complete language or framework coverage. Runtime configuration and available tools affect whether a rule runs.