{"id":"UBUNTU-CVE-2025-47917","details":"Mbed TLS before 3.6.4 allows a use-after-free in certain situations of applications that are developed in accordance with the documentation. The function mbedtls_x509_string_to_names() takes a head argument that is documented as an output argument. The documentation does not suggest that the function will free that pointer; however, the function does call mbedtls_asn1_free_named_data_list() on that argument, which performs a deep free(). As a result, application code that uses this function (relying only on documented behavior) is likely to still hold pointers to the memory blocks that were freed, resulting in a high risk of use-after-free or double-free. In particular, the two sample programs x509/cert_write and x509/cert_req are affected (use-after-free if the san string contains more than one DN).","modified":"2026-03-27T17:09:35.919212Z","published":"2025-07-20T19:15:00Z","related":["USN-8123-1"],"upstream":["CVE-2025-47917"],"references":[{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2025-47917"},{"type":"REPORT","url":"https://www.cve.org/CVERecord?id=CVE-2025-47917"},{"type":"REPORT","url":"https://github.com/Mbed-TLS/mbedtls-docs/blob/main/security-advisories/mbedtls-security-advisory-2025-06-7.md"},{"type":"ADVISORY","url":"https://ubuntu.com/security/notices/USN-8123-1"}],"affected":[{"package":{"name":"mbedtls","ecosystem":"Ubuntu:16.04:LTS","purl":"pkg:deb/ubuntu/mbedtls@2.2.1-2ubuntu0.3?arch=source&distro=xenial"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.1.2-1","2.2.0-1","2.2.1-1","2.2.1-2","2.2.1-2ubuntu0.1","2.2.1-2ubuntu0.2","2.2.1-2ubuntu0.3"],"ecosystem_specific":{"binaries":[{"binary_version":"2.2.1-2ubuntu0.3","binary_name":"libmbedcrypto0"},{"binary_version":"2.2.1-2ubuntu0.3","binary_name":"libmbedtls-dev"},{"binary_version":"2.2.1-2ubuntu0.3","binary_name":"libmbedtls10"},{"binary_version":"2.2.1-2ubuntu0.3","binary_name":"libmbedx509-0"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-47917.json"}},{"package":{"name":"mbedtls","ecosystem":"Ubuntu:Pro:18.04:LTS","purl":"pkg:deb/ubuntu/mbedtls@2.8.0-1ubuntu0.1~esm1?arch=source&distro=esm-apps/bionic"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.8.0-1ubuntu0.1~esm1"}]}],"versions":["2.5.1-1ubuntu1","2.6.0-1","2.7.0-2","2.8.0-1"],"ecosystem_specific":{"binaries":[{"binary_version":"2.8.0-1ubuntu0.1~esm1","binary_name":"libmbedcrypto1"},{"binary_version":"2.8.0-1ubuntu0.1~esm1","binary_name":"libmbedtls-dev"},{"binary_version":"2.8.0-1ubuntu0.1~esm1","binary_name":"libmbedtls10"},{"binary_version":"2.8.0-1ubuntu0.1~esm1","binary_name":"libmbedx509-0"}],"availability":"Available with Ubuntu Pro: https://ubuntu.com/pro"},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-47917.json"}},{"package":{"name":"mbedtls","ecosystem":"Ubuntu:Pro:20.04:LTS","purl":"pkg:deb/ubuntu/mbedtls@2.16.4-1ubuntu2+esm1?arch=source&distro=esm-apps/focal"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.16.4-1ubuntu2+esm1"}]}],"versions":["2.16.2-1","2.16.3-1","2.16.4-1ubuntu2"],"ecosystem_specific":{"binaries":[{"binary_version":"2.16.4-1ubuntu2+esm1","binary_name":"libmbedcrypto3"},{"binary_version":"2.16.4-1ubuntu2+esm1","binary_name":"libmbedtls-dev"},{"binary_version":"2.16.4-1ubuntu2+esm1","binary_name":"libmbedtls12"},{"binary_version":"2.16.4-1ubuntu2+esm1","binary_name":"libmbedx509-0"}],"availability":"Available with Ubuntu Pro: https://ubuntu.com/pro"},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-47917.json"}},{"package":{"name":"mbedtls","ecosystem":"Ubuntu:Pro:22.04:LTS","purl":"pkg:deb/ubuntu/mbedtls@2.28.0-1ubuntu0.1~esm1?arch=source&distro=esm-apps/jammy"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.28.0-1ubuntu0.1~esm1"}]}],"versions":["2.16.9-0.1ubuntu1","2.16.11-0.1ubuntu1","2.16.11-0.3","2.28.0-1","2.28.0-1build1"],"ecosystem_specific":{"binaries":[{"binary_version":"2.28.0-1ubuntu0.1~esm1","binary_name":"libmbedcrypto7"},{"binary_version":"2.28.0-1ubuntu0.1~esm1","binary_name":"libmbedtls-dev"},{"binary_version":"2.28.0-1ubuntu0.1~esm1","binary_name":"libmbedtls14"},{"binary_version":"2.28.0-1ubuntu0.1~esm1","binary_name":"libmbedx509-1"}],"availability":"Available with Ubuntu Pro: https://ubuntu.com/pro"},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-47917.json"}},{"package":{"name":"mbedtls","ecosystem":"Ubuntu:Pro:24.04:LTS","purl":"pkg:deb/ubuntu/mbedtls@2.28.8-1ubuntu0.1~esm1?arch=source&distro=esm-apps/noble"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.28.8-1ubuntu0.1~esm1"}]}],"versions":["2.28.3-1","2.28.6-1ubuntu1","2.28.7-1ubuntu1","2.28.7-1.1ubuntu1","2.28.8-1"],"ecosystem_specific":{"binaries":[{"binary_version":"2.28.8-1ubuntu0.1~esm1","binary_name":"libmbedcrypto7t64"},{"binary_version":"2.28.8-1ubuntu0.1~esm1","binary_name":"libmbedtls-dev"},{"binary_version":"2.28.8-1ubuntu0.1~esm1","binary_name":"libmbedtls14t64"},{"binary_version":"2.28.8-1ubuntu0.1~esm1","binary_name":"libmbedx509-1t64"}],"availability":"Available with Ubuntu Pro: https://ubuntu.com/pro"},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-47917.json"}},{"package":{"name":"mbedtls","ecosystem":"Ubuntu:25.10","purl":"pkg:deb/ubuntu/mbedtls@3.6.2-3ubuntu1?arch=source&distro=questing"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.6.2-3ubuntu1"],"ecosystem_specific":{"binaries":[{"binary_version":"3.6.2-3ubuntu1","binary_name":"libmbedcrypto16"},{"binary_version":"3.6.2-3ubuntu1","binary_name":"libmbedtls-dev"},{"binary_version":"3.6.2-3ubuntu1","binary_name":"libmbedtls21"},{"binary_version":"3.6.2-3ubuntu1","binary_name":"libmbedx509-7"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-47917.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:H/A:H"},{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"},{"type":"Ubuntu","score":"medium"}]}