CVE-2020-13846: Github.com/sylabs/singularity "Verify All" Returns Success Despite Vulnerability

HIGH
Advisory Identifier: GHSA-6w7g-p4jh-rf92
CVSS 7.5
Published
Advisory Summary

CVE-2020-13846 is a HIGH (CVSS 7.5) "verify all" returns success despite vulnerability (General Security Weakness) affecting Github.com/sylabs/singularity libraries in the Go ecosystem. The issue involves "verify all" returns success despite validation failures in singularity. Remediation is available by upgrading affected packages to version 3.6.0.

CVE-2020-13846 at a Glance

CVE Identifier CVE-2020-13846
GHSA Identifier GHSA-6w7g-p4jh-rf92
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification General Security Weakness
Affected Product Github.com/sylabs/singularity
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.5

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

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

How to Fix CVE-2020-13846

To remediate this vulnerability, upgrade all affected Github.com/sylabs/singularity 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/sylabs/singularity fixed: 3.6.0
Upgrade github.com/sylabs/singularity to 3.6.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/sylabs/singularity

How to Check if You Are Affected

To determine whether your application is affected by CVE-2020-13846, inspect your project dependencies for Github.com/sylabs/singularity:

inspect dependencies for github.com/sylabs/singularity

Analyze the terminal output to locate any version of Github.com/sylabs/singularity in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.6.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 General Security Weakness. In Github.com/sylabs/singularity, 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 `--all / -a` option to `singularity verify` returns success even when some objects in a SIF container are not signed, or cannot be verified. The SIF objects that are not verified are reported in `WARNING` log messages, but a `Container Verified` message and exit code of `0` are returned. Workflows that verify a container using `--all / -a` and use the exit code as an indicator of success are vulnerable to running SIF containers that have unsigned, or modified, objects that may be exploited to introduce malicious behavior. ``` $ singularity verify -a image.sif WARNING: Missing signature for SIF descriptor 2 (JSON.Generic) WARNING: Missing signature for SIF descriptor 3 (FS) Container is signed by 1 key(s): Verifying partition: Def.FILE: 12045C8C0B1004D058DE4BEDA20C27EE7FF7BA84 [LOCAL] Unit Test <unit@test.com> [OK] Data integrity verified INFO: Container verified: image.sif $ echo $? 0 ``` ### Patches Singularity 3.6.0 has a new implementation of sign/verify that fixes this issue. All users are advised to upgrade to 3.6.0. Note that Singularity 3.6.0 uses a new signature format that is necessarily incompatible with Singularity < 3.6.0 - e.g. Singularity 3.5.3 cannot verify containers signed by 3.6.0. Version 3.6.0 includes a `--legacy-insecure` flag for the `singularity verify` command, that will perform verification of the older, and insecure, legacy signatures for compatibility with existing containers. This does not guarantee that containers have not been modified since signing, due to other issues in the legacy signature format. ### Workarounds If you are unable to update to 3.6.0 ensure that you do not rely on the return code of `singularity verify --all / -a` as an indicator of trust in a container. Note that other issues in the sign/verify implementation in Singularity < 3.6.0 allow additional means to introduce malicious behavior to a signed container. ### For more information General questions about the impact of the advisory / changes made in the 3.6.0 release can be asked in the: * [Singularity Slack Channel](https://bit.ly/2m0g3lX) * [Singularity Mailing List](https://groups.google.com/a/lbl.gov/forum/??sdf%7Csort:date#!forum/singularity) Any sensitive security concerns should be directed to: security@sylabs.io See our Security Policy here: https://sylabs.io/security-policy

CVE-2020-13846 Affected Github.com/sylabs/singularity Versions

1 component(s)
Fixed Versions:
3.6.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/sylabs/singularity
Go
≥ 3.5.0
< 3.6.0
3.6.0

References

Frequently Asked Questions

What is CVE-2020-13846?
CVE-2020-13846 is a security vulnerability in Github.com/sylabs/singularity involving "Verify All" Returns Success Despite Validation Failures in Singularity under General Security Weakness.
Which Github.com/sylabs/singularity versions are affected?
Affected versions include releases prior to 3.6.0 across affected packages: github.com/sylabs/singularity.
What version fixes CVE-2020-13846?
Upgrading to 3.6.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/sylabs/singularity affected?
Yes, github.com/sylabs/singularity is affected in releases prior to 3.6.0. Upgrade your dependency to 3.6.0 or later.
What is the CVSS score of CVE-2020-13846?
CVE-2020-13846 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2020-13846?
CVE-2020-13846 is classified under General Security Weakness.
How can I check Go dependencies for CVE-2020-13846?
Run the dependency tree command: 'inspect dependencies for github.com/sylabs/singularity'. 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-6w7g-p4jh-rf92",
  "modified" : "2023-01-20T22:03:21Z",
  "published" : "2021-12-20T18:24:43Z",
  "aliases" : [ "CVE-2020-13846" ],
  "summary" : "\"Verify All\" Returns Success Despite Validation Failures in Singularity",
  "details" : "### Impact\n\nThe `--all / -a` option to `singularity verify` returns success even when some objects in a SIF container are not signed, or cannot be verified.\n\nThe SIF objects that are not verified are reported in `WARNING` log messages, but a `Container Verified` message and exit code of `0`  are returned.\n\nWorkflows that verify a container using `--all / -a` and use the exit code as an indicator of success are vulnerable to running SIF containers that have unsigned, or modified, objects that may be exploited to introduce malicious behavior.\n\n```\n$ singularity verify -a image.sif \nWARNING: Missing signature for SIF descriptor 2 (JSON.Generic)\nWARNING: Missing signature for SIF descriptor 3 (FS)\nContainer is signed by 1 key(s):\n\nVerifying partition: Def.FILE:\n12045C8C0B1004D058DE4BEDA20C27EE7FF7BA84\n[LOCAL]   Unit Test <unit@test.com>\n[OK]      Data integrity verified\n\nINFO:    Container verified: image.sif\n\n$ echo $?\n0\n```\n\n\n### Patches\n\nSingularity 3.6.0 has a new implementation of sign/verify that fixes this issue.\n\nAll users are advised to upgrade to 3.6.0. Note that Singularity 3.6.0 uses a new signature format that is necessarily incompatible with Singularity < 3.6.0 - e.g. Singularity 3.5.3 cannot verify containers signed by 3.6.0.\n\nVersion 3.6.0 includes a `--legacy-insecure` flag for the `singularity verify` command, that will perform verification of the older, and insecure, legacy signatures for compatibility with existing containers. This does not guarantee that containers have not been modified since signing, due to other issues in the legacy signature format.\n\n### Workarounds\n\nIf you are unable to update to 3.6.0 ensure that you do not rely on the return code of `singularity verify --all / -a` as an indicator of trust in a container.\n\nNote that other issues in the sign/verify implementation in Singularity < 3.6.0 allow additional means to introduce malicious behavior to a signed container.\n\n\n### For more information\n\nGeneral questions about the impact of the advisory / changes made in the 3.6.0 release can be asked in the:\n\n* [Singularity Slack Channel](https://bit.ly/2m0g3lX)\n* [Singularity Mailing List](https://groups.google.com/a/lbl.gov/forum/??sdf%7Csort:date#!forum/singularity)\n\nAny sensitive security concerns should be directed to: security@sylabs.io\n\nSee our Security Policy here: https://sylabs.io/security-policy",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/sylabs/singularity"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.5.0"
      }, {
        "fixed" : "3.6.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/hpcng/singularity/security/advisories/GHSA-6w7g-p4jh-rf92"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-13846"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/sylabs/singularity"
  }, {
    "type" : "WEB",
    "url" : "https://medium.com/sylabs"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00046.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00059.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-security-announce/2020-09/msg00053.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-05-24T19:12:04Z",
    "nvd_published_at" : "2020-07-14T18:15:00Z"
  }
}