# CVE-2022-23538: User credentials leaked to third-party service via HTTP redirect in scs-library-client

> Attackers with S3 access can steal user credentials via HTTP redirects in the Singularity Container Services Go client, enabling impersonation.

- **Severity:** Medium 5.2 (`CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 17 Jan 2023
- **Updated:** 10 Mar 2025
- **Also known as:** CLEANSTART-2024-EW02482, GHSA-7p8m-22h4-9pj7, GO-2023-1497, UBUNTU-CVE-2022-23538, openSUSE-SU-2024:12694-1

## What is CVE-2022-23538?

CVE-2022-23538 is a medium-severity vulnerability in sylabs scs-library-client, published on 17 Jan 2023. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.

### Official description

github.com/sylabs/scs-library-client is the Go client for the Singularity Container Services (SCS) Container Library Service. 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. There is no workaround available at this time.

Weakness: CWE-522 (Insufficiently Protected Credentials)

## Which versions are affected by CVE-2022-23538?

6 open source packages ship an affected version, including github.com/sylabs/scs-library-client. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/sylabs/scs-library-client` | Go | All versions | 1.3.4 |
| `github.com/sylabs/scs-library-client` | Go | All versions | 1.3.4 |
| `github.com/sylabs/scs-library-client` | Go | All versions | 1.3.4 |
| `github.com/sylabs/scs-library-client` | Go | From 1.4.0 | 1.4.2 |
| `github.com/sylabs/scs-library-client` | Go | From 1.4.0 | 1.4.2 |
| `github.com/sylabs/scs-library-client` | Go | From 1.4.0 | 1.4.2 |
| `apptainer` | openSUSE:Tumbleweed | All versions | 1.1.6-1.1 |

Products: Sylabs Singularity Container Services Library.

## How do I fix CVE-2022-23538?

Upgrade github.com/sylabs/scs-library-client to a fixed version for your release line: 1.3.4 or 1.4.2.

## Is CVE-2022-23538 being exploited?

There is no known exploitation of CVE-2022-23538 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-23538 and fix it if it is affected.

What it is: CVE-2022-23538 is a medium-severity vulnerability in sylabs scs-library-client, published on 17 Jan 2023. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2022-23538 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/sylabs/scs-library-client (Go): affected all versions; fixed in 1.3.4
- github.com/sylabs/scs-library-client (Go): affected all versions; fixed in 1.3.4
- github.com/sylabs/scs-library-client (Go): affected all versions; fixed in 1.3.4
- github.com/sylabs/scs-library-client (Go): affected from 1.4.0; fixed in 1.4.2
- github.com/sylabs/scs-library-client (Go): affected from 1.4.0; fixed in 1.4.2
- github.com/sylabs/scs-library-client (Go): affected from 1.4.0; fixed in 1.4.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-23538/ (Markdown: https://insights.sbomify.com/CVE-2022-23538/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-23538
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-23538
- OSV: https://osv.dev/vulnerability/CVE-2022-23538

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-23538/
Summaries are generated and may contain mistakes; the official description above is the record.
