/

CVE-2026-32725

Severity:

HIGH RISK

(8.3)

Path Traversal / Authorization Bypass in SciTokens C++

CVE-2026-32725

Analyzed

Vulnerability type

Category:

Path Traversal / Authorization Bypass

CWE:

CWE-23

Impact:

Authorization Bypass and Over-Privileged Resource Access

Severity:

HIGH RISK

(8.3)

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 C++ contains an authorization bypass flaw where path-based scopes in tokens are normalized in a way that incorrectly permits parent-directory traversal.

By embedding .. segments in the scope claim, an attacker can broaden their effective authorization to directories outside the originally intended path when the library evaluates access decisions.

Affected context

This vulnerability affects applications and services that:

  • Use the SciTokens C++ library for access control decisions based on path-like scopes.
  • Rely on path-based scopes (e.g., storage or filesystem paths) embedded in SciTokens for authorization.
  • Trust the library's internal normalization of scope paths to enforce directory boundaries.

It typically arises in systems where a token's scope is meant to confine access to a subtree (such as a project directory, dataset path, or namespace) but where the presence of .. components is not explicitly rejected.

Exploit preconditions

  • Attack surface: Any API, service, or daemon that:
  • Accepts SciTokens from clients, and
  • Uses SciTokens C++ to enforce path-based authorization.
  • Required access: Ability to present a crafted SciToken to the target service (e.g., authenticated user, federated client, or any party able to obtain or construct tokens accepted by the service).
  • Trigger point: Authorization checks that:
  • Interpret the token's scope as a path, and
  • Rely on SciTokens C++ normalization to determine whether a requested path is within the allowed scope.
  • Why exploitation is possible: The library collapses .. components in scope paths instead of rejecting such scopes, allowing a malicious token to appear restricted while actually resolving to a broader, higher-level directory after normalization.

Why this happens

The underlying bug is an authorization logic flaw rooted in unsafe path normalization, aligning with CWE-23: Relative Path Traversal.

Instead of treating .. segments in scope definitions as invalid for access control, SciTokens C++ quietly normalizes them away, effectively allowing a scope to "escape" its intended directory.

This conflates path-cleanup behavior (useful for file-system operations) with security boundary enforcement, causing higher-level directories to become implicitly authorized when only a subdirectory was intended.

Potential impact

  • An attacker could access files or resources located outside the intended directory subtree associated with their token scope.
  • A user may read or manipulate datasets belonging to other users, projects, or experiments.
  • Services relying on path-based scopes for multi-tenant isolation could experience cross-tenant data exposure.
  • Logs, configuration files, or other sensitive paths adjacent to the authorized directory may become accessible, depending on how the application maps scopes to resources.

General mitigation guidance

Mitigation centers on strict validation and conservative treatment of path-like scopes:

  • Treat any scope containing .. or similar traversal constructs as invalid and reject the token for authorization purposes.
  • Apply a clear separation between path normalization and security boundary checks: first validate that the raw scope string contains only allowed patterns, then normalize.
  • Implement a whitelist of acceptable path components and enforce that scopes always remain within a configured root (e.g., by checking that the resolved path is a strict descendant of a predefined base directory).
  • Apply the principle of least privilege when mapping scopes to resources so that even if a scope is interpreted too broadly, the associated account or service identity has minimal underlying permissions.
  • Prefer canonical path comparison techniques that verify the final resolved path remains under the intended root, not just string-prefix comparisons.

How teams detect issues like this

Detection typically involves reviewing both code and configuration for improper handling of path-based scopes:

  • Static analysis and code review:
  • Look for uses of SciTokens C++ where token scopes are converted into filesystem or storage paths.
  • Flag any logic that relies solely on normalized paths without rejecting .. components in the original scope.
  • Examine authorization routines for string-prefix checks that do not first validate and canonicalize paths securely.
  • Policy and configuration audits:
  • Review access control policies that depend on path-based scopes to ensure they assume scopes are validated, not auto-corrected.
  • Confirm that operational logs or access records do not show unexpected cross-directory access patterns.
  • Runtime monitoring:
  • Monitor for resource access attempts that traverse between sibling or parent directories using token-authorized requests.
  • Use security tooling or custom middleware to log and optionally block scopes containing suspicious path segments (.., redundant slashes, or ambiguous encodings).

Sources

SourceLink
github.comgithub.com/scitokens/scitokens-cpp/commit/7951ed809967d88c00c20de414b1ff74df8c3e08
github.comgithub.com/scitokens/scitokens-cpp/security/advisories/GHSA-rqcx-mc9w-pjxp

Frequently asked

questions

Yes, in typical deployments it can be exploited remotely whenever a service accepts SciTokens over a network and relies on SciTokens C++ for path-based authorization. The attacker must be able to submit or obtain a token whose scope includes crafted path segments.

The attacker generally needs the ability to present a SciToken to a target service—often equivalent to being an authenticated or federated user. They do not need direct filesystem access; they only need the service to interpret the token's path scope for authorization.

The safest pattern is to treat any scope containing directory traversal patterns (.., backtracking segments, or ambiguous encodings) as invalid and reject it during authorization. After rejection checks, perform canonical path resolution and ensure that the resulting path is strictly confined within a predefined root for that token or tenant.

To prevent similar vulnerabilities, design authorization systems with explicit validation of path-like inputs, keep normalization separate from security decisions, and enforce invariant checks (such as "resolved path must remain under this root"). Incorporate security-focused code review, static analysis rules for path traversal, and test cases covering malicious scope patterns into the development lifecycle.

Find out what's already
exploitable in your codebase.