GHSA-h39g-6x3c-7fq9: Zio Zio Has SubFileSystem Path Confinement Vulnerability

LOW
CVSS 3.8
CWE-179 CWE-22
Published
Advisory Summary

GHSA-h39g-6x3c-7fq9 is a LOW (CVSS 3.8) zio has subfilesystem path confinement vulnerability (CWE-179: Incorrect Behavior Order: Early Validation) affecting Zio libraries in the NuGet ecosystem. The issue involves zio has subfilesystem path confinement bypass via unresolved `..` segment. Remediation is available by upgrading affected packages to version 0.22.2.

GHSA-h39g-6x3c-7fq9 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-h39g-6x3c-7fq9
Severity LOW
CVSS v3.1 Base Score 3.8
CWE Classification CWE-179: Incorrect Behavior Order: Early Validation
Affected Product Zio
Package Ecosystem NuGet
Published Date
Last Updated

Security Impact

CVSS: 3.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:N).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix GHSA-h39g-6x3c-7fq9

To remediate this vulnerability, upgrade all affected Zio dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

Zio fixed: 0.22.2
Upgrade Zio to 0.22.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for Zio

How to Check if You Are Affected

To determine whether your application is affected by GHSA-h39g-6x3c-7fq9, inspect your project dependencies for Zio:

inspect dependencies for Zio

Analyze the terminal output to locate any version of Zio in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.22.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-179: Incorrect Behavior Order: Early Validation, where the product validates input before applying protection mechanisms that modify the input, which could allow an attacker to bypass the validation via dangerous inputs that only arise after the modification. In Zio, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

# Summary `SubFileSystem` fails to confine operations to its declared sub path when the input path is `/../` (or equivalents `/../`, `/..\\`). This path passes all validation but resolves to the root of the parent filesystem, allowing directory level operations outside the intended boundary. # Affected Component `Zio.UPath.ValidateAndNormalize` `Zio.FileSystems.SubFileSystem` `UPath.ValidateAndNormalize` has a trailing slash optimisation. ```csharp if (!processParts && i + 1 == path.Length) return path.Substring(0, path.Length - 1); ``` When the input ends with `/` or `\`, and `processParts` is still false, the function strips the trailing separator and returns immediately before the `..` resolution logic runs. The input `/../` triggers this path: the trailing `/` is the last character, `processParts` has not been set (because `..` as the first relative segment after root is specifically exempted), so the function returns `/..` with the `..` segment unresolved. The resulting `UPath` with `FullName = "/.."` is absolute, contains no control characters, and no colon so it passes `FileSystem.ValidatePath` without rejection. When this path reaches `SubFileSystem.ConvertPathToDelegate`: ```csharp protected override UPath ConvertPathToDelegate(UPath path) { var safePath = path.ToRelative(); // "/..".ToRelative() = ".." return SubPath / safePath; // "/jail" / ".." = "/" (resolved by Combine) } ``` The delegate filesystem receives `/` (the root) instead of a path under `/jail`. # Proof of Concept ```csharp using Zio; using Zio.FileSystems; var root = new MemoryFileSystem(); root.CreateDirectory("/sandbox"); var sub = new SubFileSystem(root, "/sandbox"); Console.WriteLine(sub.DirectoryExists("/../")); // True (sees parent root) Console.WriteLine(sub.ConvertPathToInternal("/../")); // "/" (parent root path) ``` # Impact The escape is limited to directory level operations because appending a filename after `..` (e.g., `/../file.txt`) causes normal `..` resolution to trigger, which correctly rejects the path as going above root. Only the bare terminal `/../` (which strips to `/..`) survives. This means that exploitability is limited, and this vulnerability does not escalate to file read/write.

GHSA-h39g-6x3c-7fq9 Affected Zio Versions

1 component(s)
Fixed Versions:
0.22.2
Product / Package Ecosystem Affected Versions Fixed Version
Zio
NuGet
< 0.22.2
0.22.2

References

Frequently Asked Questions

What is GHSA-h39g-6x3c-7fq9?
GHSA-h39g-6x3c-7fq9 is a security vulnerability in Zio involving Zio has SubFileSystem Path Confinement Bypass via Unresolved `..` Segment under CWE-179: Incorrect Behavior Order: Early Validation.
Which Zio versions are affected?
Affected versions include releases prior to 0.22.2 across affected packages: Zio.
What version fixes GHSA-h39g-6x3c-7fq9?
Upgrading to 0.22.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is Zio affected?
Yes, Zio is affected in releases prior to 0.22.2. Upgrade your dependency to 0.22.2 or later.
What is the CVSS score of GHSA-h39g-6x3c-7fq9?
GHSA-h39g-6x3c-7fq9 has a CVSS v3.1 base score of 3.8 (LOW) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:N.
What CWE is associated with GHSA-h39g-6x3c-7fq9?
GHSA-h39g-6x3c-7fq9 is classified under CWE-179: Incorrect Behavior Order: Early Validation (The product validates input before applying protection mechanisms that modify the input, which could allow an attacker to bypass the validation via dangerous inputs that only arise after the modification.).
How can I check NuGet dependencies for GHSA-h39g-6x3c-7fq9?
Run the dependency tree command: 'inspect dependencies for Zio'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-h39g-6x3c-7fq9",
  "modified" : "2026-04-18T00:55:19Z",
  "published" : "2026-04-18T00:55:19Z",
  "aliases" : [ ],
  "summary" : "Zio has SubFileSystem Path Confinement Bypass via Unresolved `..` Segment",
  "details" : "# Summary\n\n`SubFileSystem` fails to confine operations to its declared sub path when the input path is `/../` (or equivalents `/../`, `/..\\\\`). This path passes all validation but resolves to the root of the parent filesystem, allowing directory level operations outside the intended boundary.\n\n# Affected Component\n\n`Zio.UPath.ValidateAndNormalize`\n`Zio.FileSystems.SubFileSystem`\n\n`UPath.ValidateAndNormalize` has a trailing slash optimisation.\n\n```csharp\nif (!processParts && i + 1 == path.Length)\n    return path.Substring(0, path.Length - 1);\n```\n\nWhen the input ends with `/` or `\\`, and `processParts` is still false, the function strips the trailing separator and returns immediately before the `..` resolution logic runs.  The input `/../` triggers this path: the trailing `/` is the last character, `processParts` has not been set (because `..` as the first relative segment after root is specifically exempted), so the function returns `/..` with the `..` segment unresolved.\n\nThe resulting `UPath` with `FullName = \"/..\"` is absolute, contains no control characters, and no colon so it passes `FileSystem.ValidatePath` without rejection.\n\nWhen this path reaches `SubFileSystem.ConvertPathToDelegate`:\n\n```csharp\nprotected override UPath ConvertPathToDelegate(UPath path)\n{\n    var safePath = path.ToRelative();     // \"/..\".ToRelative() = \"..\"\n    return SubPath / safePath;            // \"/jail\" / \"..\" = \"/\"  (resolved by Combine)\n}\n```\n\nThe delegate filesystem receives `/` (the root) instead of a path under `/jail`.\n\n# Proof of Concept\n\n```csharp\nusing Zio;\nusing Zio.FileSystems;\n\nvar root = new MemoryFileSystem();\nroot.CreateDirectory(\"/sandbox\");\nvar sub = new SubFileSystem(root, \"/sandbox\");\n\nConsole.WriteLine(sub.DirectoryExists(\"/../\"));           // True (sees parent root)\nConsole.WriteLine(sub.ConvertPathToInternal(\"/../\"));     // \"/\" (parent root path)\n```\n\n# Impact\n\nThe escape is limited to directory level operations because appending a filename after `..` (e.g., `/../file.txt`) causes normal `..` resolution to trigger, which correctly rejects the path as going above root.  Only the bare terminal `/../` (which strips to `/..`) survives.  This means that exploitability is limited, and this vulnerability does not escalate to file read/write.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "Zio"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.22.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.22.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/xoofx/zio/security/advisories/GHSA-h39g-6x3c-7fq9"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/xoofx/zio/commit/c8c2f5328e50c1e7ab8c5c405fe70e0bd35f4782"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/xoofx/zio"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/xoofx/zio/releases/tag/0.22.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-179", "CWE-22" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-18T00:55:19Z",
    "nvd_published_at" : null
  }
}