# CVE-2018-10903: PyCA Cryptography vulnerable to GCM tag forgery

> Attackers can forge GCM tags due to missing length validation, potentially leaking keys or bypassing integrity checks in applications using python-cryptography.

- **Severity:** High 7.5 (`CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 30 Jul 2018
- **Updated:** 5 Aug 2024
- **Also known as:** DEBIAN-CVE-2018-10903, GHSA-fcf9-3qw3-gxmj, MGASA-2018-0429, PYSEC-2018-52, RHSA-2018:3600, SUSE-SU-2018:3392-1, SUSE-SU-2018:3553-1, SUSE-SU-2020:0790-1, SUSE-SU-2020:0792-1, SUSE-SU-2022:4044-1, UBUNTU-CVE-2018-10903, USN-3720-1

## What is CVE-2018-10903?

CVE-2018-10903 is a high-severity vulnerability in Canonical Ubuntu Linux, published on 30 Jul 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

A flaw was found in python-cryptography versions between >=1.9.0 and <2.3. The finalize_with_tag API did not enforce a minimum tag length. If a user did not validate the input length prior to passing it to finalize_with_tag an attacker could craft an invalid payload with a shortened tag (e.g. 1 byte) such that they would have a 1 in 256 chance of passing the MAC check. GCM tag forgeries can cause key leakage.

Weakness: CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2018-10903?

3 open source packages ship an affected version, including cryptography. It affects 3 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `cryptography` | PyPI | From 1.9 | 2.3 |
| `cryptography` | PyPI | From 1.9.0 | 2.3 |
| `cryptography` | PyPI | From 1.9.0 | 2.3 |
| `python-cryptography` | Red Hat:openstack:13::el7 | All versions | 0:2.1.4-3.el7ost |
| `python-cryptography-debuginfo` | Red Hat:openstack:13::el7 | All versions | 0:2.1.4-3.el7ost |
| `python2-cryptography` | Red Hat:openstack:13::el7 | All versions | 0:2.1.4-3.el7ost |
| `python-cffi` | SUSE:Enterprise Storage 5 | All versions | 1.11.2-5.11.1 |
| `python-cryptography` | SUSE:Enterprise Storage 5 | All versions | 2.1.4-7.28.2 |
| `python-xattr` | SUSE:Enterprise Storage 5 | All versions | 0.7.5-6.3.2 |
| `python-cryptography` | SUSE:Enterprise Storage 7 | All versions | 2.9.2-150200.13.1 |
| `python-cffi` | SUSE:HPE Helion OpenStack 8 | All versions | 1.11.2-5.11.1 |
| `python-cryptography` | SUSE:HPE Helion OpenStack 8 | All versions | 2.0.3-3.3.1 |
| `python-cryptography` | SUSE:HPE Helion OpenStack 8 | All versions | 2.1.4-7.28.2 |
| `python-xattr` | SUSE:HPE Helion OpenStack 8 | All versions | 0.7.5-6.3.2 |
| `python-cryptography` | SUSE:Linux Enterprise High Performance Computing 15 SP2-ESPOS | All versions | 2.9.2-150200.13.1 |
| `python-cryptography` | SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 2.9.2-150200.13.1 |
| `python-cryptography` | SUSE:Linux Enterprise Micro 5.1 | All versions | 2.9.2-150200.13.1 |
| `python-cryptography` | SUSE:Linux Enterprise Micro 5.2 | All versions | 2.9.2-150200.13.1 |
| `python-cryptography` | SUSE:Linux Enterprise Module for Basesystem 15 | All versions | 2.1.4-4.3.1 |
| `python-cryptography` | SUSE:Linux Enterprise Module for Basesystem 15 SP3 | All versions | 2.9.2-150200.13.1 |
| `python-cryptography` | SUSE:Linux Enterprise Module for Python 2 15 SP3 | All versions | 2.9.2-150200.13.1 |
| `python-cffi` | SUSE:Linux Enterprise Server 12 SP1-LTSS | All versions | 1.11.2-2.19.2 |
| `python-cryptography` | SUSE:Linux Enterprise Server 12 SP1-LTSS | All versions | 2.1.4-3.15.5 |
| `python-xattr` | SUSE:Linux Enterprise Server 12 SP1-LTSS | All versions | 0.7.5-3.2.1 |
| `python-cffi` | SUSE:Linux Enterprise Server 12 SP2-BCL | All versions | 1.11.2-5.11.1 |
| `python-cryptography` | SUSE:Linux Enterprise Server 12 SP2-BCL | All versions | 2.1.4-7.28.2 |
| `python-xattr` | SUSE:Linux Enterprise Server 12 SP2-BCL | All versions | 0.7.5-6.3.2 |
| `python-cffi` | SUSE:Linux Enterprise Server 12 SP2-LTSS | All versions | 1.11.2-5.11.1 |
| `python-cryptography` | SUSE:Linux Enterprise Server 12 SP2-LTSS | All versions | 2.1.4-7.28.2 |
| `python-xattr` | SUSE:Linux Enterprise Server 12 SP2-LTSS | All versions | 0.7.5-6.3.2 |
| `python-cffi` | SUSE:Linux Enterprise Server 12 SP3-BCL | All versions | 1.11.2-5.11.1 |
| `python-cryptography` | SUSE:Linux Enterprise Server 12 SP3-BCL | All versions | 2.1.4-7.28.2 |
| `python-xattr` | SUSE:Linux Enterprise Server 12 SP3-BCL | All versions | 0.7.5-6.3.2 |
| `python-cffi` | SUSE:Linux Enterprise Server 12 SP3-LTSS | All versions | 1.11.2-5.11.1 |
| `python-cryptography` | SUSE:Linux Enterprise Server 12 SP3-LTSS | All versions | 2.1.4-7.28.2 |
| `python-xattr` | SUSE:Linux Enterprise Server 12 SP3-LTSS | All versions | 0.7.5-6.3.2 |
| `python-cffi` | SUSE:Linux Enterprise Server 12 SP4 | All versions | 1.11.2-5.11.1 |
| `python-cryptography` | SUSE:Linux Enterprise Server 12 SP4 | All versions | 2.1.4-7.28.2 |
| `python-xattr` | SUSE:Linux Enterprise Server 12 SP4 | All versions | 0.7.5-6.3.2 |
| `python-cffi` | SUSE:Linux Enterprise Server 12 SP5 | All versions | 1.11.2-5.11.1 |

Products: Canonical Ubuntu Linux, Cryptography Python-Cryptography, Redhat Openstack.

## How do I fix CVE-2018-10903?

Upgrade cryptography to 2.3 or later.

## Is CVE-2018-10903 being exploited?

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

## Other vulnerabilities in Canonical Ubuntu Linux

- [CVE-2020-11651](https://insights.sbomify.com/CVE-2020-11651/): SaltStack Salt Authentication Bypass (critical 9.8, exploited in the wild)
- [CVE-2020-7247](https://insights.sbomify.com/CVE-2020-7247/): OpenSMTPD Remote Code Execution (critical 9.8, exploited in the wild)
- [CVE-2019-16928](https://insights.sbomify.com/CVE-2019-16928/): Exim Out-of-bounds Write (critical 9.8, exploited in the wild)
- [CVE-2018-6789](https://insights.sbomify.com/CVE-2018-6789/): Exim Buffer Overflow (critical 9.8, exploited in the wild)
- [CVE-2015-2590](https://insights.sbomify.com/CVE-2015-2590/): Oracle Java SE and Java SE Embedded Remote Code Execution (critical 9.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2018-10903 and fix it if it is affected.

What it is: CVE-2018-10903 is a high-severity vulnerability in Canonical Ubuntu Linux, published on 30 Jul 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2018-10903 in the wild and no public exploit code.

Affected packages and fixed versions:
- cryptography (PyPI): affected from 1.9; fixed in 2.3
- cryptography (PyPI): affected from 1.9.0; fixed in 2.3
- cryptography (PyPI): affected from 1.9.0; fixed in 2.3

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

## Sources

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

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