GHSA-H39G-6X3C-7FQ9

Vulnerability from github – Published: 2026-04-18 00:55 – Updated: 2026-04-18 00:55
VLAI
Summary
Zio has SubFileSystem Path Confinement Bypass via Unresolved `..` Segment
Details

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.

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:

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

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.

Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 0.22.1"
      },
      "package": {
        "ecosystem": "NuGet",
        "name": "Zio"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0.22.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [],
  "database_specific": {
    "cwe_ids": [
      "CWE-179",
      "CWE-22"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-04-18T00:55:19Z",
    "nvd_published_at": null,
    "severity": "LOW"
  },
  "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 \u0026\u0026 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.",
  "id": "GHSA-h39g-6x3c-7fq9",
  "modified": "2026-04-18T00:55:19Z",
  "published": "2026-04-18T00:55:19Z",
  "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"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Zio has SubFileSystem Path Confinement Bypass via Unresolved `..` Segment"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…