Code Injection Affecting keras package, versions [,2.13.1rc0)


0.0
critical

Snyk CVSS

    Attack Complexity Low
    Confidentiality High
    Integrity High
    Availability High

    Threat Intelligence

    EPSS 0.04% (9th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-PYTHON-KERAS-6615954
  • published 17 Apr 2024
  • disclosed 16 Apr 2024
  • credit Jeffrey Havrilla, Allen Householder, Andrew Kompanek, Ben Koo

How to fix?

Upgrade keras to version 2.13.1rc0 or higher.

Overview

keras is a Keras is a high-level neural networks API for Python..

Affected versions of this package are vulnerable to Code Injection due to improper user input sanitization through the Lambda layer, allowing a developer to add arbitrary Python code to a model in the form of a lambda function. An attacker could use this feature to trojanize a popular model, save it, and redistribute it, tainting the supply chain of dependent AI/ML applications. In addition, exploiting this vulnerability allows arbitrary code to be executed with the same permissions as the application.

Note

If running pre-2.13 applications in a sandbox, ensure no assets of value are in scope of the running application to minimize the potential for data exfiltration.