/

CVE-2026-32727

Severity:

HIGH RISK

(8.1)

Path Traversal in SciTokens Enforcer Scope Handling

CVE-2026-32727

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Directory Traversal and Unauthorized File Access

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

SciTokens Enforcer contained a path traversal flaw that allowed attackers to craft scope claims with .. segments to escape intended directory restrictions.

By abusing the library's path normalization and prefix comparison logic, an attacker with control over a token's scope claim could gain access to files or directories outside the authorized path.

Affected context

This vulnerability affects applications that rely on SciTokens' Enforcer component to enforce filesystem-like scoping for resource access.

It becomes relevant when:

  • Authorization decisions are based on path prefixes derived from token scope claims
  • The Enforcer's path comparison is used to gate access to directories or file-like resources
  • Attackers can influence or obtain tokens whose scope values are used directly for path authorization

In such deployments, the Enforcer's normalization plus prefix check can allow .. segments to escape intended directory boundaries.

Exploit preconditions

  • Attack surface: Any service or application that:
  • Uses SciTokens Enforcer for path-based authorization, and
  • Treats scope claims as directory or resource prefixes.
  • Required access: Ability to present or obtain a token whose scope claim can be set or influenced (e.g., via a compromised issuer, misconfigured token service, or attacker-controlled client requesting broad scopes).
  • Trigger point: The Enforcer's comparison of:
  • The authorized path derived from the token scope, and
  • The requested path from the application,

where both are normalized and then compared using startswith.

  • Why exploitation is possible: The authorization logic interprets matching prefixes of normalized paths as sufficient proof of containment.

By embedding .. segments within the scope or requested path, an attacker can construct paths that normalize to locations outside the intended directory, while still passing the prefix check.

Why this happens

The core issue is an unsafe path authorization pattern: path containment is determined via string prefix comparison after normalization, rather than true filesystem-aware containment checks.

The Enforcer:

  • Normalizes the authorized path from the token's scope claim
  • Normalizes the requested path from the application
  • Uses startswith (or equivalent) to decide whether the requested path is within the authorized path

This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, because:

  • Authorization depends on string operations instead of reliable directory boundary checks
  • .. segments and crafted paths can escape the intended directory despite apparent prefix matches.

Potential impact

  • Attackers may access files or directories outside the intended scoped directory.
  • Sensitive configuration or data files could be exposed through services that rely on SciTokens Enforcer for access control.
  • Path-based quotas or isolation boundaries can be bypassed, affecting tenant or user separation guarantees.
  • Downstream services that trust the Enforcer's decision could be tricked into performing operations on unintended paths.

General mitigation guidance

Effective mitigation focuses on robust path containment checks and defensive handling of scope-based paths:

  • Use filesystem-aware containment logic instead of string prefix checks (e.g., resolve canonical paths and verify that the requested path is a descendant of the authorized path).
  • Treat any user- or token-sourced path components as untrusted, enforcing strict validation and rejecting paths containing .. or ambiguous segments.
  • Normalize paths in a way that aligns with the host filesystem's semantics, and perform access checks on canonical (fully resolved) paths only.
  • Design scope semantics to be declarative (e.g., resource IDs or abstract capabilities) rather than raw filesystem paths when possible.
  • Apply least privilege: scope tokens to the minimal directory or resource set needed, and avoid granting broad top-level scopes.

How teams detect issues like this

Detection efforts can focus on code patterns and authorization flows:

  • Static analysis and code review:
  • Flag use of startswith or similar string prefix checks for path authorization.
  • Look for locations where scope claims or other token fields are interpreted directly as filesystem paths.
  • Identify normalization routines that do not subsequently verify directory containment using canonical path comparisons.
  • Policy and CI enforcement:
  • Introduce secure coding guidelines that forbid string-based path containment checks.
  • Add automated checks (e.g., linters, SAST tools) to detect fragile path authorization patterns.
  • Runtime monitoring and logging:
  • Log requested paths and associated scopes for sensitive operations.
  • Monitor for suspicious patterns such as frequent use of .. segments in requested resources, especially when combined with SciTokens-based authorization.

Sources

SourceLink
github.comgithub.com/scitokens/scitokens/commit/2d1cc9e42bc944fe0bbc429b85d166e7156d53f9
github.comgithub.com/scitokens/scitokens/pull/230
github.comgithub.com/scitokens/scitokens/releases/tag/v1.9.7
github.comgithub.com/scitokens/scitokens/security/advisories/GHSA-3x2w-63fp-3qvw

Frequently asked

questions

Yes, in many deployments. If a service is exposed over a network and relies on SciTokens Enforcer to gate access to path-based resources, a remote attacker who can obtain or supply tokens may exploit the flaw.

The attacker needs the ability to present tokens whose scope value is used in authorization. This typically means being an authenticated client of the token issuer, abusing misconfigured issuing policies, or compromising a component that issues tokens.

Replace string prefix checks with canonical, filesystem-aware path containment checks:

  • Resolve both the authorized and requested paths to their canonical form, and
  • Verify that the requested path lies within the authorized directory tree.

Additionally, reject or sanitize any .. segments in scope-derived paths.

Avoid treating user- or token-controlled data as raw filesystem paths, adopt robust path normalization and containment checks, enforce secure coding standards around path authorization, and include automated checks in CI to detect fragile path comparison logic.

Find out what's already
exploitable in your codebase.