# GHSA-87mp-xc4x-x8rh: asymmetricrypt/asymmetricrypt Padding Oracle Vulnerability in RSA Encryption

> An attacker can decrypt RSA ciphertexts via a padding oracle attack due to insecure PKCS#1 v1.5 padding usage in the AsymmetriCrypt library.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 15 May 2024

## What is GHSA-87mp-xc4x-x8rh?

GHSA-87mp-xc4x-x8rh is a vulnerability in asymmetricrypt/asymmetricrypt, published on 15 May 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The encryption and decryption process were vulnerable against the Bleichenbacher's attack, which is a padding oracle vulnerability disclosed in the 98'.
The issue was about the wrong padding utilized, which allowed to retrieve the encrypted content.
The OPENSSL_PKCS1_PADDING version, aka PKCS v1.5 was vulnerable (is the one set by default when using openssl_* methods), while the PKCS v2.0 isn't anymore (it's also called OAEP).

A fix for this vulnerability was merged at https://github.com/Cosmicist/AsymmetriCrypt/pull/5/commits/a0318cfc5022f2a7715322dba3ff91d475ace7c6.

## Which versions are affected by GHSA-87mp-xc4x-x8rh?

2 open source packages ship an affected version, including asymmetricrypt/asymmetricrypt.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `asymmetricrypt/asymmetricrypt` | Packagist | All versions to 0.3.0 | None |
| `asymmetricrypt/asymmetricrypt` | Packagist | All versions to 0.3.0 | None |

## How do I fix GHSA-87mp-xc4x-x8rh?

No fix has been published for GHSA-87mp-xc4x-x8rh yet. Limit exposure of the affected software until one is available.

## Is GHSA-87mp-xc4x-x8rh being exploited?

There is no known exploitation of GHSA-87mp-xc4x-x8rh in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-87mp-xc4x-x8rh and fix it if it is affected.

What it is: GHSA-87mp-xc4x-x8rh is a vulnerability in asymmetricrypt/asymmetricrypt, published on 15 May 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-87mp-xc4x-x8rh in the wild and no public exploit code.

Affected packages and fixed versions:
- asymmetricrypt/asymmetricrypt (Packagist): affected all versions up to 0.3.0; no fix listed
- asymmetricrypt/asymmetricrypt (Packagist): affected all versions up to 0.3.0; no fix listed

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/GHSA-87mp-xc4x-x8rh/ (Markdown: https://insights.sbomify.com/GHSA-87mp-xc4x-x8rh/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-87mp-xc4x-x8rh

---
From sbomify Insights: https://insights.sbomify.com/GHSA-87mp-xc4x-x8rh/
Summaries are generated and may contain mistakes; the official description above is the record.
