-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
ASVSAnything related to ASVS requirementsAnything related to ASVS requirementsL1ASVS L1 requirementASVS L1 requirementdocumentationImprovements or additions to documentationImprovements or additions to documentationsecurityIssues related to security postureIssues related to security posture
Description
Source: V10.4.2 audit — Observation 2
Description
In src/asfquart/generics.py (line ~69), the OAuth token exchange uses a Python assert statement to verify the response from the authorization server:
assert rv.status == 200, "Could not verify oauth response."assert statements are stripped when Python is run with the -O (optimize) flag. If the application were ever started with optimization enabled, this check would be silently skipped, potentially allowing the OAuth flow to proceed with a failed or malicious token exchange response.
Recommendation
- Document we cannot run with
-Oflag
Or replace with explicit exception handling:
if rv.status != 200:
return quart.Response(status=403, response="OAuth authentication failed.")Severity
Low — requires the unlikely condition of running with -O, but violates defense-in-depth principles for an authentication-critical code path.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
ASVSAnything related to ASVS requirementsAnything related to ASVS requirementsL1ASVS L1 requirementASVS L1 requirementdocumentationImprovements or additions to documentationImprovements or additions to documentationsecurityIssues related to security postureIssues related to security posture