CVE-2022-23538: Github.com/sylabs/scs library client Scs-library-client May Leak User Credentials Vulnerability

MODERATE
Advisory Identifier: GHSA-7p8m-22h4-9pj7
CVSS 5.2
CWE-522 CWE-601
Published
Advisory Summary

CVE-2022-23538 is a MODERATE (CVSS 5.2) scs-library-client may leak user credentials vulnerability (CWE-522: Insufficiently Protected Credentials) affecting Github.com/sylabs/scs library client libraries in the Go ecosystem. The issue involves scs-library-client may leak user credentials to third-party service via http redirect. Remediation is available by upgrading affected packages to version 1.4.2, 1.3.4.

CVE-2022-23538 at a Glance

CVE Identifier CVE-2022-23538
GHSA Identifier GHSA-7p8m-22h4-9pj7
Severity MODERATE
CVSS v3.1 Base Score 5.2
CWE Classification CWE-522: Insufficiently Protected Credentials
Affected Product Github.com/sylabs/scs library client
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.2

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

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

How to Fix CVE-2022-23538

To remediate this vulnerability, upgrade all affected Github.com/sylabs/scs library client 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/scs-library-client fixed: 1.4.2
Upgrade github.com/sylabs/scs-library-client to 1.4.2
github.com/sylabs/scs-library-client fixed: 1.3.4
Upgrade github.com/sylabs/scs-library-client to 1.3.4
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/scs-library-client

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-23538, inspect your project dependencies for Github.com/sylabs/scs library client:

inspect dependencies for github.com/sylabs/scs-library-client

Analyze the terminal output to locate any version of Github.com/sylabs/scs library client in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.4.2), 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-522: Insufficiently Protected Credentials, where the product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval. In Github.com/sylabs/scs library client, 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 When the scs-library-client is used to pull a container image, with authentication, the HTTP Authorization header sent by the client to the library service may be incorrectly leaked to an S3 backing storage provider. This occurs in a specific flow, where the library service redirects the client to a backing S3 storage server, to perform a multi-part concurrent download. Depending on site configuration, the S3 service may be provided by a third party. An attacker with access to the S3 service may be able to extract user credentials, allowing them to impersonate the user. The vulnerable multi-part concurrent download flow, with redirect to S3, is only used when communicating with a Singularity Enterprise 1.x installation, or third party server implementing this flow. Interaction with Singularity Enterprise 2.x, and Singularity Container Services (cloud.sylabs.io), does not trigger the vulnerable flow. We encourage all users to update. Users who interact with a Singularity Enterprise 1.x installation, using a 3rd party S3 storage service, are advised to revoke and recreate their authentication tokens within Singularity Enterprise. ### Patches The security issue was identified after the integration of a bug-fix commit 68ac4ca into the previously released scs-library-client 1.3.4. This commit fixes the security issue in the 1.3 series. scs-library-client 1.4.2 contains a fix for the same vulnerability in the 1.4 series, as commit eebd7ca. ### Workarounds There is no workaround available at this time. As above, access to Singularity Enterprise 2.x, or Singularity Container Services (cloud.sylabs.io), does not trigger the vulnerable flow. ### References https://cwe.mitre.org/data/definitions/522.html

CVE-2022-23538 Affected Github.com/sylabs/scs library client Versions

2 component(s)
Fixed Versions:
1.4.21.3.4
Product / Package Ecosystem Affected Versions Fixed Version
github.com/sylabs/scs-library-client
Go
≥ 1.4.0
< 1.4.2
1.4.2
github.com/sylabs/scs-library-client
Go
< 1.3.4
1.3.4

References

Frequently Asked Questions

What is CVE-2022-23538?
CVE-2022-23538 is a security vulnerability in Github.com/sylabs/scs library client involving scs-library-client may leak user credentials to third-party service via HTTP redirect under CWE-522: Insufficiently Protected Credentials.
Which Github.com/sylabs/scs library client versions are affected?
Affected versions include releases prior to 1.4.2, 1.3.4 across affected packages: github.com/sylabs/scs-library-client.
What version fixes CVE-2022-23538?
Upgrading to 1.4.2, 1.3.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/sylabs/scs-library-client affected?
Yes, github.com/sylabs/scs-library-client is affected in releases prior to 1.4.2, 1.3.4. Upgrade your dependency to 1.4.2, 1.3.4 or later.
What is the CVSS score of CVE-2022-23538?
CVE-2022-23538 has a CVSS v3.1 base score of 5.2 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:L/A:N.
What CWE is associated with CVE-2022-23538?
CVE-2022-23538 is classified under CWE-522: Insufficiently Protected Credentials (The product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval.).
How can I check Go dependencies for CVE-2022-23538?
Run the dependency tree command: 'inspect dependencies for github.com/sylabs/scs-library-client'. 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-7p8m-22h4-9pj7",
  "modified" : "2023-01-20T22:38:04Z",
  "published" : "2023-01-20T22:38:04Z",
  "aliases" : [ "CVE-2022-23538" ],
  "summary" : "scs-library-client may leak user credentials to third-party service via HTTP redirect",
  "details" : "### Impact\n\nWhen the scs-library-client is used to pull a container image, with authentication, the HTTP Authorization header sent by the client to the library service may be incorrectly leaked to an S3 backing storage provider. This occurs in a specific flow, where the library service redirects the client to a backing S3 storage server, to perform a multi-part concurrent download.\n\nDepending on site configuration, the S3 service may be provided by a third party. An attacker with access to the S3 service may be able to extract user credentials, allowing them to impersonate the user.\n\nThe vulnerable multi-part concurrent download flow, with redirect to S3, is only used when communicating with a Singularity Enterprise 1.x installation, or third party server implementing this flow.\n\nInteraction with Singularity Enterprise 2.x, and Singularity Container Services (cloud.sylabs.io), does not trigger the vulnerable flow.\n\nWe encourage all users to update. Users who interact with a Singularity Enterprise 1.x installation, using a 3rd party S3 storage service, are advised to revoke and recreate their authentication tokens within Singularity Enterprise.\n\n### Patches\n\nThe security issue was identified after the integration of a bug-fix commit 68ac4ca into the previously released scs-library-client 1.3.4. This commit fixes the security issue in the 1.3 series.\n\nscs-library-client 1.4.2 contains a fix for the same vulnerability in the 1.4 series, as commit eebd7ca.\n\n### Workarounds\n\nThere is no workaround available at this time.\n\nAs above, access to Singularity Enterprise 2.x, or Singularity Container Services (cloud.sylabs.io), does not trigger the vulnerable flow.\n\n### References\n\nhttps://cwe.mitre.org/data/definitions/522.html\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/sylabs/scs-library-client"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.4.0"
      }, {
        "fixed" : "1.4.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/sylabs/scs-library-client"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.3.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/sylabs/scs-library-client/security/advisories/GHSA-7p8m-22h4-9pj7"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-23538"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sylabs/scs-library-client/commit/68ac4cab5cda0afd8758ff5b5e2e57be6a22fcfa"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sylabs/scs-library-client/commit/b5db2aacba6bf1231f42dd475cc32e6355ab47b2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sylabs/scs-library-client/commit/eebd7caaab310b1fa803e55b8fc1acd9dcd2d00c"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/sylabs/scs-library-client"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2023-1497"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-522", "CWE-601" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-01-20T22:38:04Z",
    "nvd_published_at" : "2023-01-17T21:15:00Z"
  }
}