CVE-2021-41087: Github.com/in toto/in toto golang Improperly Implemented Path Matching For Vulnerability

MODERATE
Advisory Identifier: GHSA-vrxp-mg9f-hwf3
CVSS 5.6
CWE-345 CWE-22
Published
Advisory Summary

CVE-2021-41087 is a MODERATE (CVSS 5.6) improperly implemented path matching for vulnerability (CWE-345: Insufficient Verification of Data Authenticity) affecting Github.com/in toto/in toto golang libraries in the Go ecosystem. The issue involves improperly implemented path matching for in-toto-golang. Remediation is available by upgrading affected packages to version 0.3.0.

CVE-2021-41087 at a Glance

CVE Identifier CVE-2021-41087
GHSA Identifier GHSA-vrxp-mg9f-hwf3
Severity MODERATE
CVSS v3.1 Base Score 5.6
CWE Classification CWE-345: Insufficient Verification of Data Authenticity
Affected Product Github.com/in toto/in toto golang
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.6

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

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

How to Fix CVE-2021-41087

To remediate this vulnerability, upgrade all affected Github.com/in toto/in toto golang 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/in-toto/in-toto-golang fixed: 0.3.0
Upgrade github.com/in-toto/in-toto-golang to 0.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 github.com/in-toto/in-toto-golang

How to Check if You Are Affected

To determine whether your application is affected by CVE-2021-41087, inspect your project dependencies for Github.com/in toto/in toto golang:

inspect dependencies for github.com/in-toto/in-toto-golang

Analyze the terminal output to locate any version of Github.com/in toto/in toto golang in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.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-345: Insufficient Verification of Data Authenticity, where the product does not sufficiently verify the origin or authenticity of data, in a way that causes it to accept invalid data. In Github.com/in toto/in toto golang, 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 Authenticated attackers posing as functionaries (i.e., within a trusted set of users for a layout) are able to create attestations that may bypass DISALLOW rules in the same layout. An attacker with access to trusted private keys, may issue an attestation that contains a disallowed artifact by including path traversal semantics (e.g., foo vs dir/../foo). ### Patches The problem has been fixed in version 0.3.0. ### Workarounds Exploiting this vulnerability is dependent on the specific policy applied. ### For more information If you have any questions or comments about this advisory: * Open an issue in [in-toto-golang](http://github.com/in-toto/in-toto-golang) * Email us at [in-toto-public](mailto:in-toto-public@googlegroups.com) * If this is a sensitive security-relevant disclosure, please send a PGP encrypted email to santiagotorres@purdue.edu or jcappos@nyu.edu

CVE-2021-41087 Affected Github.com/in toto/in toto golang Versions

1 component(s)
Fixed Versions:
0.3.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/in-toto/in-toto-golang
Go
< 0.3.0
0.3.0

References

Frequently Asked Questions

What is CVE-2021-41087?
CVE-2021-41087 is a security vulnerability in Github.com/in toto/in toto golang involving Improperly Implemented path matching for in-toto-golang under CWE-345: Insufficient Verification of Data Authenticity.
Which Github.com/in toto/in toto golang versions are affected?
Affected versions include releases prior to 0.3.0 across affected packages: github.com/in-toto/in-toto-golang.
What version fixes CVE-2021-41087?
Upgrading to 0.3.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/in-toto/in-toto-golang affected?
Yes, github.com/in-toto/in-toto-golang is affected in releases prior to 0.3.0. Upgrade your dependency to 0.3.0 or later.
What is the CVSS score of CVE-2021-41087?
CVE-2021-41087 has a CVSS v3.1 base score of 5.6 (MODERATE) with vector string CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:N/I:H/A:N.
What CWE is associated with CVE-2021-41087?
CVE-2021-41087 is classified under CWE-345: Insufficient Verification of Data Authenticity (The product does not sufficiently verify the origin or authenticity of data, in a way that causes it to accept invalid data.).
How can I check Go dependencies for CVE-2021-41087?
Run the dependency tree command: 'inspect dependencies for github.com/in-toto/in-toto-golang'. 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-vrxp-mg9f-hwf3",
  "modified" : "2021-09-21T21:51:18Z",
  "published" : "2021-09-22T20:37:09Z",
  "aliases" : [ "CVE-2021-41087" ],
  "summary" : "Improperly Implemented path matching for in-toto-golang",
  "details" : "### Impact\nAuthenticated attackers posing as functionaries (i.e., within a trusted set of users for a layout) are able to create attestations that may bypass DISALLOW rules in the same layout. An attacker with access to trusted private keys, may issue an attestation that contains a disallowed artifact by including path traversal semantics (e.g., foo vs dir/../foo).\n\n### Patches\nThe problem has been fixed in version 0.3.0.\n\n### Workarounds\nExploiting this vulnerability is dependent on the specific policy applied.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [in-toto-golang](http://github.com/in-toto/in-toto-golang)\n* Email us at [in-toto-public](mailto:in-toto-public@googlegroups.com)\n* If this is a sensitive security-relevant disclosure, please send a PGP encrypted email to santiagotorres@purdue.edu or jcappos@nyu.edu\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/in-toto/in-toto-golang"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.3.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.2.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/in-toto/in-toto-golang/security/advisories/GHSA-vrxp-mg9f-hwf3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-41087"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/in-toto/in-toto-golang/commit/f2c57d1e0f15e3ffbeac531829c696b72ecc4290"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/in-toto/in-toto-golang"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-345" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-09-21T21:51:18Z",
    "nvd_published_at" : "2021-09-21T21:15:00Z"
  }
}