PSF-2019-13

Vulnerability from osv_psf – Published: 2019-07-01 00:00 – Updated: 0001-01-01 00:00 – Source website
VLAI
Summary
ssl.match_hostname() ignores extra string after whitespace in IPv4 address
Details

inet_aton() accepts trailing characters after a valid IP. Because of that, Python ssl.match_hostname('1.1.1.1 ; this should not work but does') succeeded when it should fail.

The issue was introduced in bpo-32819 <https://bugs.python.org/issue32819>_ by commit aef1283b <https://github.com/python/cpython/commit/aef1283ba428e33397d87cee3c54a5110861552d>_. Only Python 3.7 and newer are affected. It's a potential security bug although low severity. For one Python 3.7 and newer no longer use ssl.match_hostname() to verify hostnames and IP addresses of a certificate: matching is performed by OpenSSL.

It should not possible to register a x509 certificate with a hostname with spaces.

The glibc function inet_aton() accepts input as valid if said input is a IPv4 address followed by zero or more characters that are valid white-space as decided by isspace(), with the rest of the string after the first white-space being ignored. As '\r' is a valid white-space character the rest of the string is ignored (including the '\r'). See glibc bug 24111: Deprecate inet_addr, inet_aton <https://sourceware.org/bugzilla/show_bug.cgi?id=24111>_.

References
Impacted products
Ecosystem Package Version
Git github.com/python/cpython
Affected: < 070fae6d0ff4, < 3cba3d3c55f2, < 477b1b257689 (git)

{
  "affected": [
    {
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "070fae6d0ff49e63bfd5f2bdc66f8eb1df3b6557"
            },
            {
              "fixed": "3cba3d3c55f230a59174a0dfcafb1d4685269e60"
            },
            {
              "fixed": "477b1b25768945621d466a8b3f0739297a842439"
            }
          ],
          "repo": "https://github.com/python/cpython",
          "type": "GIT"
        }
      ]
    }
  ],
  "database_specific": {
    "cwe_ids": []
  },
  "details": "``inet_aton()`` accepts trailing characters after a valid IP.  Because of\nthat, Python ``ssl.match_hostname(\u00271.1.1.1 ; this should not work but does\u0027)``\nsucceeded when it should fail.\n\nThe issue was introduced in `bpo-32819\n\u003chttps://bugs.python.org/issue32819\u003e`_ by `commit aef1283b\n\u003chttps://github.com/python/cpython/commit/aef1283ba428e33397d87cee3c54a5110861552d\u003e`_.\nOnly Python 3.7 and newer are affected. It\u0027s a potential security bug\nalthough **low severity**. For one Python 3.7 and newer **no longer use**\n``ssl.match_hostname()`` to verify hostnames and IP addresses of a\ncertificate: **matching is performed by OpenSSL**.\n\nIt should not possible to register a x509 certificate with a hostname with\nspaces.\n\nThe glibc function ``inet_aton()`` accepts input as valid if said input is\na IPv4 address followed by zero or more characters that are valid\nwhite-space as decided by ``isspace()``, with the rest of the string after\nthe first white-space being ignored. As ``\u0027\\r\u0027`` is a valid white-space\ncharacter the rest of the string is ignored (including the ``\u0027\\r\u0027``). See\n`glibc bug 24111: Deprecate inet_addr, inet_aton\n\u003chttps://sourceware.org/bugzilla/show_bug.cgi?id=24111\u003e`_.\n",
  "id": "PSF-2019-13",
  "modified": "0001-01-01T00:00:00Z",
  "published": "2019-07-01T00:00:00Z",
  "references": [
    {
      "type": "REPORT",
      "url": "https://bugs.python.org/issue37463"
    }
  ],
  "schema_version": "1.5.0",
  "summary": "ssl.match_hostname() ignores extra string after whitespace in IPv4 address"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.