Researchers Uncover Flaws in Python Package for AI Models and PDF.js Used by Firefox
Vulnerabilities mentionedAll →
| CVE | Vulnerability | CVSS | EPSS | Flags | Affected | Exposure | Published |
|---|---|---|---|---|---|---|---|
| CVE-2024-34359 | llama-cpp-python is the Python bindings for llama.cpp. llama-cpp-python is the Python bindings for llama.cpp. `llama-cpp-python` depends on class `Llama` in `llama.py` to load `.gguf` llama.cpp or Latency Machine Learning Models. The `__init__` constructor built in the `Llama` takes several parameters to configure the loading and running of the model. Other than `NUMA, LoRa settings`, `loading tokenizers,` and `hardware settings`, `__init__` also loads the `chat template` from targeted `.gguf` 's Metadata and furtherly parses it to `llama_chat_format.Jinja2ChatFormatter.to_chat_handler()` to construct the `self.chat_handler` for this model. Nevertheless, `Jinja2ChatFormatter` parse the `chat template` within the Metadate with sandbox-less `jinja2.Environment`, which is furthermore rendered in `__call__` to construct the `prompt` of interaction. This allows `jinja2` Server Side Template Injection which leads to remote code execution by a carefully constructed payload. NVD description · AI analysis pending | 9.6 | 28% | — | — | ||
| CVE-2024-4367 | A type check was missing when handling fonts in PDF.js, which would allow arbitrary JavaScript execution in the PDF.js context. A type check was missing when handling fonts in PDF.js, which would allow arbitrary JavaScript execution in the PDF.js context. This vulnerability affects Firefox < 126, Firefox ESR < 115.11, and Thunderbird < 115.11. NVD description · AI analysis pending | 8.8 | 71% |
| — |
Full article414 words · extracted from thehackernews.com · click to collapse
Ravie LakshmananMay 21, 2024Supply Chain Security / AI Model
A critical security flaw has been disclosed in the llama_cpp_python Python package that could be exploited by threat actors to achieve arbitrary code execution.
Tracked as CVE-2024-34359 (CVSS score: 9.7), the flaw has been codenamed Llama Drama by software supply chain security firm Checkmarx.
"If exploited, it could allow attackers to execute arbitrary code on your system, compromising data and operations," security researcher Guy Nachshon said.
llama_cpp_python, a Python binding for the llama.cpp library, is a popular package with over 3 million downloads to date, allowing developers to integrate AI models with Python.
Security researcher Patrick Peng (retr0reg) has been credited with discovering and reporting the flaw, which has been addressed in version 0.2.72.
The core issue stems from the misuse of the Jinja2 template engine within the llama_cpp_python package, allowing for server-side template injection that leads to remote code execution by means of a specially crafted payload.
"The exploitation of this vulnerability can lead to unauthorized actions by attackers, including data theft, system compromise, and disruption of operations," Checkmarx said.
"The discovery of CVE-2024-34359 serves as a stark reminder of the vulnerabilities that can arise at the confluence of AI and supply chain security. It highlights the need for vigilant security practices throughout the lifecycle of AI systems and their components."
Code Execution Flaw in PDF.js
The development follows the discovery of a high-severity flaw in Mozilla's PDF.js JavaScript library (CVE-2024-4367) that could allow the execution of arbitrary code.
"A type check was missing when handling fonts in PDF.js, which would allow arbitrary JavaScript execution in the PDF.js context," Mozilla said in an advisory.
Codean Labs, which characterized the flaw as an "oversight in a specific part of the font rendering code," said it permits an attacker to execute JavaScript code as soon as a malware-laced PDF document is opened in the Firefox browser.
The issue has been addressed in Firefox 126, Firefox ESR 115.11, and Thunderbird 115.11 shipped last week. It has also been resolved in the npm module pdfjs-dist version 4.2.67 released on April 29, 2024.
"Most wrapper libraries like react-pdf have also released patched versions," security researcher Thomas Rinsma said. "Because some higher level PDF-related libraries statically embed PDF.js, we recommend recursively checking your node_modules folder for files called pdf.js to be sure."
Found this article interesting? Follow us on Google News, Twitter and LinkedIn to read more exclusive content we post.
Text extracted automatically; images, tables and formatting may be missing. Original: https://thehackernews.com/2024/05/researchers-uncover-flaws-in-python.html