# CVE-2021-32635: Action Commands (run/shell/exec) Against Library URIs Ignore Configured Remote Endpoint

> Attackers can execute malicious containers by exploiting incorrect remote endpoint resolution in Singularity action commands, requiring non-default remote configurations.

- **Severity:** Medium 6.3 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 28 May 2021
- **Updated:** 3 Aug 2024
- **Also known as:** GHSA-5mv9-q7fq-9394, UBUNTU-CVE-2021-32635

## What is CVE-2021-32635?

CVE-2021-32635 is a medium-severity vulnerability in sylabs singularity, published on 28 May 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

Singularity is an open source container platform. In verions 3.7.2 and 3.7.3, Dde to incorrect use of a default URL, `singularity` action commands (`run`/`shell`/`exec`) specifying a container using a `library://` URI will always attempt to retrieve the container from the default remote endpoint (`cloud.sylabs.io`) rather than the configured remote endpoint. An attacker may be able to push a malicious container to the default remote endpoint with a URI that is identical to the URI used by a victim with a non-default remote endpoint, thus executing the malicious container. Only action commands (`run`/`shell`/`exec`) against `library://` URIs are affected. Other commands such as `pull` / `push` respect the configured remote endpoint. The vulnerability is patched in Singularity version 3.7.4. Two possible workarounds exist: Users can only interact with the default remote endpoint, or an installation can have an execution control list configured to restrict execution to containers signed with specific secure keys.

Weakness: CWE-923 (Improper Restriction of Communication Channel to Intended Endpoints), CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2021-32635?

2 open source packages ship an affected version, including github.com/sylabs/singularity. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/sylabs/singularity` | Go | From 3.7.2 | 3.7.4 |
| `github.com/sylabs/singularity` | Go | From 3.7.2 | 3.7.4 |

Products: Sylabs Singularity.

## How do I fix CVE-2021-32635?

Upgrade github.com/sylabs/singularity to 3.7.4 or later.

## Is CVE-2021-32635 being exploited?

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

## Other vulnerabilities in sylabs singularity

- [CVE-2021-33027](https://insights.sbomify.com/CVE-2021-33027/): Weak cryptography in n/a (critical 9.8)
- [CVE-2021-33622](https://insights.sbomify.com/CVE-2021-33622/): Other in n/a (critical 9.8)
- [CVE-2018-19295](https://insights.sbomify.com/CVE-2018-19295/): Sylabs Singularity Improper Input Validation (high 7.8)
- [CVE-2020-13845](https://insights.sbomify.com/CVE-2020-13845/): Execution Control List (ECL) Is Insecure in Singularity (high 7.5)
- [CVE-2020-13846](https://insights.sbomify.com/CVE-2020-13846/): "Verify All" Returns Success Despite Validation Failures in Singularity (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-32635 and fix it if it is affected.

What it is: CVE-2021-32635 is a medium-severity vulnerability in sylabs singularity, published on 28 May 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2021-32635 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/sylabs/singularity (Go): affected from 3.7.2; fixed in 3.7.4
- github.com/sylabs/singularity (Go): affected from 3.7.2; fixed in 3.7.4

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-2021-32635/ (Markdown: https://insights.sbomify.com/CVE-2021-32635/index.md)
```

## Sources

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

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