# CVE-2018-1000159: tlslite-ng off-by-one error on mac checking

- Severity: Medium 5.9 (CVSS:3.0, scored by NVD) `CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.77%, higher than 56% of CVEs (2026-12-01)
- Published: 2018-04-18T19:00:00.000Z
- Modified: 2026-06-17T01:32:33.520Z
- Also known as: GHSA-cwh5-3cw7-4286, PYSEC-2018-31
- Weaknesses: CWE-354
- Assigned by: mitre

## Description

tlslite-ng version 0.7.3 and earlier, since commit d7b288316bca7bcdd082e6ccff5491e241305233 contains a CWE-354: Improper Validation of Integrity Check Value vulnerability in TLS implementation, tlslite/utils/constanttime.py: ct_check_cbc_mac_and_pad(); line "end_pos = data_len - 1 - mac.digest_size" that can result in an attacker manipulating the TLS ciphertext which will not be detected by receiving tlslite-ng. This attack appears to be exploitable via man in the middle on a network connection. This vulnerability appears to have been fixed after commit 3674815d1b0f7484454995e2737a352e0a6a93d8.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- tlslite-ng (PyPI): before 0.7.4
- tlslite-ng_project tlslite-ng: up to 0.7.3

## Every score

- GitHub: CVSS:3.0 5.9 High `CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N`
- GitHub: CVSS:4.0 High `CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N`
- NVD: CVSS:3.0 5.9 Medium `CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N`
- NVD: CVSS:2.0 4.3 Medium `AV:N/AC:M/Au:N/C:N/I:P/A:N`

## References

- <https://github.com/tomato42/tlslite-ng/pull/234> (third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2018-1000159> (advisory)
- <https://github.com/tlsfuzzer/tlslite-ng/pull/234/commits/3674815d1b0f7484454995e2737a352e0a6a93d8> (web)
- <https://github.com/tlsfuzzer/tlslite-ng/commit/d7b288316bca7bcdd082e6ccff5491e241305233> (web)
- <https://github.com/pypa/advisory-database/tree/main/vulns/tlslite-ng/PYSEC-2018-31.yaml> (web)
- <https://github.com/tomato42/tlslite-ng> (package)
- <https://github.com/advisories/GHSA-cwh5-3cw7-4286> (advisory)

## Sources

- CVE List: [CVE-2018-1000159](https://www.cve.org/CVERecord?id=CVE-2018-1000159), CVE Terms of Use, modified 2024-08-05
- GitHub Advisory Database: [GHSA-cwh5-3cw7-4286](https://github.com/advisories/GHSA-cwh5-3cw7-4286), CC-BY-4.0, modified 2024-11-24
- NVD: [CVE-2018-1000159](https://nvd.nist.gov/vuln/detail/CVE-2018-1000159), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2018-31](https://osv.dev/vulnerability/PYSEC-2018-31), CC-BY-4.0, modified 2023-11-08

---

Page: https://cve.day/CVE-2018-1000159 · Whole record: https://cve.day/CVE-2018-1000159.json · Rebuilt by cve.day 2026-11-25T22:57:37.281Z
