{"id":"UBUNTU-CVE-2025-24359","details":"ASTEVAL is an evaluator of Python expressions and statements. Prior to version 1.0.6, if an attacker can control the input to the `asteval` library, they can bypass asteval's restrictions and execute arbitrary Python code in the context of the application using the library. The vulnerability is rooted in how `asteval` performs handling of `FormattedValue` AST nodes. In particular, the `on_formattedvalue` value uses the dangerous format method of the str class. The code allows an attacker to manipulate the value of the string used in the dangerous call `fmt.format(__fstring__=val)`. This vulnerability can be exploited to access protected attributes by intentionally triggering an `AttributeError` exception. The attacker can then catch the exception and use its `obj` attribute to gain arbitrary access to sensitive or protected object properties. Version 1.0.6 fixes this issue.","modified":"2025-10-24T05:18:08Z","published":"2025-01-24T17:15:00Z","upstream":["CVE-2025-24359"],"references":[{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2025-24359"},{"type":"REPORT","url":"https://www.cve.org/CVERecord?id=CVE-2025-24359"},{"type":"REPORT","url":"https://github.com/lmfit/asteval/security/advisories/GHSA-3wwr-3g9f-9gc7"},{"type":"REPORT","url":"https://github.com/lmfit/asteval/blob/cfb57f0beebe0dc0520a1fbabc35e66060c7ea71/asteval/asteval.py#L507"},{"type":"REPORT","url":"https://lucumr.pocoo.org/2016/12/29/careful-with-str-format"}],"affected":[{"package":{"name":"python-asteval","ecosystem":"Ubuntu:20.04:LTS","purl":"pkg:deb/ubuntu/python-asteval@0.9.17-1?arch=source&distro=focal"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.9.12-1","0.9.12-2","0.9.17-1"],"ecosystem_specific":{"binaries":[{"binary_name":"python3-asteval","binary_version":"0.9.17-1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-24359.json"}},{"package":{"name":"python-asteval","ecosystem":"Ubuntu:22.04:LTS","purl":"pkg:deb/ubuntu/python-asteval@0.9.25-2?arch=source&distro=jammy"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.9.19-2","0.9.25-2"],"ecosystem_specific":{"binaries":[{"binary_name":"python3-asteval","binary_version":"0.9.25-2"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-24359.json"}},{"package":{"name":"python-asteval","ecosystem":"Ubuntu:24.04:LTS","purl":"pkg:deb/ubuntu/python-asteval@0.9.31-1?arch=source&distro=noble"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.9.30-1","0.9.31-1"],"ecosystem_specific":{"binaries":[{"binary_name":"python3-asteval","binary_version":"0.9.31-1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-24359.json"}}],"schema_version":"1.7.3","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"},{"type":"Ubuntu","score":"medium"}]}