GHSA-3jhm-87m6-x959: Github.com/cloudflare/cfrpki Path Traversal Vulnerability

HIGH
CWE-22
Published
Advisory Summary

GHSA-3jhm-87m6-x959 is a HIGH path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Github.com/cloudflare/cfrpki libraries in the Go ecosystem. The issue involves path traversal mitigation bypass in octorpki. Remediation is available by upgrading affected packages to version 1.4.3.

GHSA-3jhm-87m6-x959 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-3jhm-87m6-x959
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Github.com/cloudflare/cfrpki
Package Ecosystem Go
Published Date
Last Updated

How to Fix GHSA-3jhm-87m6-x959

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

github.com/cloudflare/cfrpki fixed: 1.4.3
Upgrade github.com/cloudflare/cfrpki to 1.4.3
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 github.com/cloudflare/cfrpki

How to Check if You Are Affected

To determine whether your application is affected by GHSA-3jhm-87m6-x959, inspect your project dependencies for Github.com/cloudflare/cfrpki:

inspect dependencies for github.com/cloudflare/cfrpki

Analyze the terminal output to locate any version of Github.com/cloudflare/cfrpki in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.4.3), 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 Github.com/cloudflare/cfrpki, 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 existing URI path filters in OctoRPKI (version < 1.4.3) mitigating Path traversal vulnerability could be bypassed by an attacker. In case a malicious TAL file is parsed, it was possible to write files outside the base cache folder. ### Specific Go Packages Affected github.com/cloudflare/cfrpki/cmd/octorpki ### Patches The issue was fixed in version 1.4.3 ### References [CVE-2021-3907](https://www.cvedetails.com/cve/CVE-2021-3907/)

GHSA-3jhm-87m6-x959 Affected Github.com/cloudflare/cfrpki Versions

1 component(s)
Fixed Versions:
1.4.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/cloudflare/cfrpki
Go
< 1.4.3
1.4.3

References

Frequently Asked Questions

What is GHSA-3jhm-87m6-x959?
GHSA-3jhm-87m6-x959 is a security vulnerability in Github.com/cloudflare/cfrpki involving Path traversal mitigation bypass in OctoRPKI under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Github.com/cloudflare/cfrpki versions are affected?
Affected versions include releases prior to 1.4.3 across affected packages: github.com/cloudflare/cfrpki.
What version fixes GHSA-3jhm-87m6-x959?
Upgrading to 1.4.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/cloudflare/cfrpki affected?
Yes, github.com/cloudflare/cfrpki is affected in releases prior to 1.4.3. Upgrade your dependency to 1.4.3 or later.
What CWE is associated with GHSA-3jhm-87m6-x959?
GHSA-3jhm-87m6-x959 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-3jhm-87m6-x959?
Run the dependency tree command: 'inspect dependencies for github.com/cloudflare/cfrpki'. 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-3jhm-87m6-x959",
  "modified" : "2023-10-02T11:02:19Z",
  "published" : "2022-06-25T07:12:08Z",
  "aliases" : [ ],
  "summary" : "Path traversal mitigation bypass in OctoRPKI",
  "details" : "### Impact\nThe existing URI path filters in OctoRPKI (version < 1.4.3) mitigating Path traversal vulnerability could be bypassed by an attacker. In case a malicious TAL file is parsed, it was possible to write files outside the base cache folder.\n\n### Specific Go Packages Affected\ngithub.com/cloudflare/cfrpki/cmd/octorpki\n\n### Patches\nThe issue was fixed in version 1.4.3\n\n### References\n[CVE-2021-3907](https://www.cvedetails.com/cve/CVE-2021-3907/)\n\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cloudflare/cfrpki"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.4.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/cloudflare/cfrpki/security/advisories/GHSA-3jhm-87m6-x959"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cloudflare/cfrpki/security/advisories/GHSA-cqh2-vc2f-q4fh"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-3907"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cloudflare/cfrpki"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cloudflare/cfrpki/releases/tag/v1.4.3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-25T07:12:08Z",
    "nvd_published_at" : null
  }
}