CVE-2018-1000159: Tlslite ng Tlslite-ng Off-by-one Error On Mac Vulnerability

HIGH
Advisory Identifier: GHSA-cwh5-3cw7-4286
CVSS 5.9
CWE-354
Published
Advisory Summary

CVE-2018-1000159 is a HIGH (CVSS 5.9) tlslite-ng off-by-one error on mac vulnerability (CWE-354: Improper Validation of Integrity Check Value) affecting Tlslite ng libraries in the PyPI ecosystem. The issue involves tlslite-ng off-by-one error on mac checking. Remediation is available by upgrading affected packages to version 0.7.4.

CVE-2018-1000159 at a Glance

CVE Identifier CVE-2018-1000159
GHSA Identifier GHSA-cwh5-3cw7-4286
Severity HIGH
CVSS v3.1 Base Score 5.9
CWE Classification CWE-354: Improper Validation of Integrity Check Value
Affected Product Tlslite ng
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2018-1000159

To remediate this vulnerability, upgrade all affected Tlslite ng dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

tlslite-ng fixed: 0.7.4
pip install tlslite-ng>=0.7.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show tlslite-ng

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2018-1000159, inspect your installed packages using pip:

pip show tlslite-ng

Analyze the terminal output to locate any version of Tlslite ng in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.7.4), your application is affected.

Note: The pip show tlslite-ng command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-354: Improper Validation of Integrity Check Value, where the product does not validate or incorrectly validates the integrity check values or "checksums" of a message. this may prevent it from detecting if the data has been modified or corrupted in transmission. In Tlslite ng, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

tlslite-ng version 0.7.3 and earlier, since commit [d7b288316bca7bcdd082e6ccff5491e241305233](https://github.com/tlsfuzzer/tlslite-ng/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](https://github.com/tlsfuzzer/tlslite-ng/pull/234/commits/3674815d1b0f7484454995e2737a352e0a6a93d8).

CVE-2018-1000159 Affected Tlslite ng Versions

1 component(s)
Fixed Versions:
0.7.4
Product / Package Ecosystem Affected Versions Fixed Version
tlslite-ng
PyPI
< 0.7.4
0.7.4

References

Frequently Asked Questions

What is CVE-2018-1000159?
CVE-2018-1000159 is a security vulnerability in Tlslite ng involving tlslite-ng off-by-one error on mac checking under CWE-354: Improper Validation of Integrity Check Value.
Which Tlslite ng versions are affected?
Affected versions include releases prior to 0.7.4 across affected packages: tlslite-ng.
What version fixes CVE-2018-1000159?
Upgrading to 0.7.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is tlslite-ng affected?
Yes, tlslite-ng is affected in releases prior to 0.7.4. Upgrade your dependency to 0.7.4 or later.
What is the CVSS score of CVE-2018-1000159?
CVE-2018-1000159 has a CVSS v3.1 base score of 5.9 (HIGH) with vector string CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2018-1000159?
CVE-2018-1000159 is classified under CWE-354: Improper Validation of Integrity Check Value (The product does not validate or incorrectly validates the integrity check values or "checksums" of a message. This may prevent it from detecting if the data has been modified or corrupted in transmission.).
How can I check PyPI dependencies for CVE-2018-1000159?
Run the dependency tree command: 'pip show tlslite-ng'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-cwh5-3cw7-4286",
  "modified" : "2024-11-13T22:51:51Z",
  "published" : "2018-07-12T20:30:44Z",
  "aliases" : [ "CVE-2018-1000159" ],
  "summary" : "tlslite-ng off-by-one error on mac checking",
  "details" : "tlslite-ng version 0.7.3 and earlier, since commit [d7b288316bca7bcdd082e6ccff5491e241305233](https://github.com/tlsfuzzer/tlslite-ng/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](https://github.com/tlsfuzzer/tlslite-ng/pull/234/commits/3674815d1b0f7484454995e2737a352e0a6a93d8).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "tlslite-ng"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.7.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-1000159"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/tlsfuzzer/tlslite-ng/pull/234/commits/3674815d1b0f7484454995e2737a352e0a6a93d8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/tomato42/tlslite-ng/pull/234"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/tlsfuzzer/tlslite-ng/commit/d7b288316bca7bcdd082e6ccff5491e241305233"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/tlslite-ng/PYSEC-2018-31.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/tomato42/tlslite-ng"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-354" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:33:04Z",
    "nvd_published_at" : null
  }
}