GHSA-p799-q2pr-6mxj: Go.rgst.io/stencil/v2 Path Traversal Vulnerability

MODERATE
CWE-22
Published
Advisory Summary

GHSA-p799-q2pr-6mxj is a MODERATE path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Go.rgst.io/stencil/v2 libraries in the Go ecosystem. The issue involves go.rgst.io/stencil/v2 vulnerable to path traversal. Remediation is available by upgrading affected packages to version 2.3.0.

GHSA-p799-q2pr-6mxj at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-p799-q2pr-6mxj
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Go.rgst.io/stencil/v2
Package Ecosystem Go
Published Date
Last Updated

How to Fix GHSA-p799-q2pr-6mxj

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

go.rgst.io/stencil/v2 fixed: 2.3.0
Upgrade go.rgst.io/stencil/v2 to 2.3.0
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 go.rgst.io/stencil/v2

How to Check if You Are Affected

To determine whether your application is affected by GHSA-p799-q2pr-6mxj, inspect your project dependencies for Go.rgst.io/stencil/v2:

inspect dependencies for go.rgst.io/stencil/v2

Analyze the terminal output to locate any version of Go.rgst.io/stencil/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.3.0), 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-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Go.rgst.io/stencil/v2, 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

### Impact The library used to extract archives (github.com/jaredallard/archives) was vulnerable to the "zip slip" vulnerability. This is used to extract native extension archives and repository source archives. A native extension or repository archive could be crafted in such a way where a remote code execution or modification/reading of a file is possible using the user who is running stencil. The severity is marked as "medium" because native extensions have always considered to be "unsafe" to run when not trusted. Native extensions are arbitrary code being ran, which could always do this same exploit with less steps. The medium severity is to reflect that this could be done even when a user is _not_ using a native extension, for example a repository source archive. However, one would need to mutate the archives provided by Github or perform some hackery with links, which may not be possible. Thus, "medium" is used out of an abundance of caution where I would've labeled this as "low". ### Patches Patched in 2.3.0 and above. ### Workarounds No workarounds are present. ### References https://github.com/jaredallard/archives/security/advisories/GHSA-j95m-rcjp-q69h

GHSA-p799-q2pr-6mxj Affected Go.rgst.io/stencil/v2 Versions

1 component(s)
Fixed Versions:
2.3.0
Product / Package Ecosystem Affected Versions Fixed Version
go.rgst.io/stencil/v2
Go
< 2.3.0
2.3.0

References

Frequently Asked Questions

What is GHSA-p799-q2pr-6mxj?
GHSA-p799-q2pr-6mxj is a security vulnerability in Go.rgst.io/stencil/v2 involving go.rgst.io/stencil/v2 vulnerable to Path Traversal under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Go.rgst.io/stencil/v2 versions are affected?
Affected versions include releases prior to 2.3.0 across affected packages: go.rgst.io/stencil/v2.
What version fixes GHSA-p799-q2pr-6mxj?
Upgrading to 2.3.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is go.rgst.io/stencil/v2 affected?
Yes, go.rgst.io/stencil/v2 is affected in releases prior to 2.3.0. Upgrade your dependency to 2.3.0 or later.
What CWE is associated with GHSA-p799-q2pr-6mxj?
GHSA-p799-q2pr-6mxj is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check Go dependencies for GHSA-p799-q2pr-6mxj?
Run the dependency tree command: 'inspect dependencies for go.rgst.io/stencil/v2'. 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-p799-q2pr-6mxj",
  "modified" : "2025-03-29T00:08:44Z",
  "published" : "2025-03-29T00:08:44Z",
  "aliases" : [ ],
  "summary" : "go.rgst.io/stencil/v2 vulnerable to Path Traversal",
  "details" : "### Impact\n\nThe library used to extract archives (github.com/jaredallard/archives) was vulnerable to the \"zip slip\" vulnerability. This is used to extract native extension archives and repository source archives. A native extension or repository archive could be crafted in such a way where a remote code execution or modification/reading of a file is possible using the user who is running stencil.\n\nThe severity is marked as \"medium\" because native extensions have always considered to be \"unsafe\" to run when not trusted. Native extensions are arbitrary code being ran, which could always do this same exploit with less steps. The medium severity is to reflect that this could be done even when a user is _not_ using a native extension, for example a repository source archive. However, one would need to mutate the archives provided by Github or perform some hackery with links, which may not be possible. Thus, \"medium\" is used out of an abundance of caution where I would've labeled this as \"low\".\n\n### Patches\n\nPatched in 2.3.0 and above.\n\n### Workarounds\n\nNo workarounds are present.\n\n### References\n\nhttps://github.com/jaredallard/archives/security/advisories/GHSA-j95m-rcjp-q69h",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "go.rgst.io/stencil/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.3.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/jaredallard/archives/security/advisories/GHSA-j95m-rcjp-q69h"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rgst-io/stencil/security/advisories/GHSA-p799-q2pr-6mxj"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rgst-io/stencil/pull/255"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rgst-io/stencil/commit/5482fcada0c6f77d903d13129bd656b7df80ac3a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rgst-io/stencil"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-03-29T00:08:44Z",
    "nvd_published_at" : null
  }
}