Monday, April 28, 2025
HomeCVE/vulnerabilityCritical Vulnerability in Meta Llama Framework Let Remote Attackers Execute Arbitrary Code

Critical Vulnerability in Meta Llama Framework Let Remote Attackers Execute Arbitrary Code

Published on

SIEM as a Service

Follow Us on Google News

The Oligo Research team has disclosed a critical vulnerability in Meta’s widely used Llama-stack framework.

This vulnerability, tracked as CVE-2024-50050, allows remote attackers to execute arbitrary code on servers running the Llama-stack framework.

Due to its potential impact, the flaw has been rated as critical with a CVSS score of 9.3 (v4.0) and 9.8 (v3.1).

- Advertisement - Google News

The Meta Llama Framework and Its Importance

Meta introduced the Llama-stack framework in July 2024 as an open-source solution to simplify the development and deployment of generative AI (GenAI) applications based on its Llama family of large language models (LLMs).

meta-llama had only 200 stars when we discovered the vulnerability and has since catapulted to nearly 6,000 in just a few months.
meta-llama had only 200 stars when we discovered the vulnerability and has since catapulted to nearly 6,000 in just a few months.

This framework offers developers tools and APIs to train, deploy, and operate AI models efficiently, enabling faster innovation in AI-powered applications.

Are you from SOC/DFIR Teams? - Analyse Malware Files & Links with ANY.RUN Sandox -> Try for Free

The adoption of the Llama-stack framework has grown rapidly, with backing from industry giants like AWS, NVIDIA, and Dell.

The vulnerable method in llama-stack
The vulnerable method in llama-stack

It has also gained traction among developers worldwide, accumulating over 6,000 stars on GitHub. However, this popularity has now brought attention to the unforeseen security risks embedded in the framework’s code.

The flaw resides in a Python method, recv_pyobj, used in the default Python inference server of the Llama-stack framework.

This method leverages Python’s pickle module to deserialize serialized objects received via a network socket.

The pickle module, while powerful, is notoriously insecure when used with untrusted data because it can execute arbitrary commands during the deserialization process.

Attackers exploiting this vulnerability can send maliciously crafted data to a Llama-stack server. When the server deserializes this data using recv_pyobj, it executes the attacker’s commands, potentially allowing full control over the server.

This opens the door to various malicious activities, such as resource theft, data breaches, and tampering with hosted AI models.

The vulnerability stems from the use of the pyzmq library, a Python implementation of the ZeroMQ messaging protocol.

While pyzmq’s recv_pyobj method is efficient, the library itself warns against its unsafe use with untrusted sources due to its reliance on the insecure pickle.loads function.

Meta’s default inference implementation improperly exposed this function over the network, leaving it susceptible to exploitation.

Proof-of-Concept Exploit

Security researchers from Oligo demonstrated how the vulnerability could be exploited. By scanning for open ports on systems running Llama-stack and sending a specially crafted malicious payload, they achieved remote code execution (RCE).

class RCE:
   def __reduce__(self):
       import os
       cmd = 'touch /tmp/pickle_rce_created_this_file.txt && echo RCE'
       return os.system, (cmd,)

For example, attackers could run arbitrary commands on the compromised server using a custom Python class that defines a method to execute shell commands.

Oligo responsibly disclosed the vulnerability to Meta on September 29, 2024. Meta responded promptly and released a patch within two weeks, addressing the issue in version 0.0.41 of the Llama-stack framework.

After running the POC exploit on a demo cluster, the attack graph (Evidence) in the Oligo Platform.
After running the POC exploit on a demo cluster, the attack graph (Evidence) in the Oligo Platform.

The fix replaced the vulnerable pickle-based deserialization with a more secure JSON-based implementation using the Pydantic library, which enforces type safety and removes the risk of arbitrary code execution.

The maintainer of pyzmq also introduced warnings in the documentation, advising developers against using recv_pyobj with untrusted data in the future.

  1. Immediate Upgrade: To protect against this critical vulnerability, all users of the Llama-stack framework are urged to upgrade to version 0.0.41 or higher.
  2. Secure Design Practices: Avoid using modules like Pickle to deserialize untrusted data. Opt for safer alternatives such as JSON or Pydantic.
  3. Monitor Open Ports: Regularly scan for open ports and monitor network activity to detect potential exploitation attempts.

The discovery of CVE-2024-50050 highlights the inherent risks in open-source development, where even widely adopted frameworks can harbor critical vulnerabilities.

Meta’s swift response underscores its commitment to maintaining the security of its AI ecosystem.

Integrating Application Security into Your CI/CD Workflows Using Jenkins & Jira -> Free Webinar

Divya
Divya
Divya is a Senior Journalist at GBhackers covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.

Latest articles

China Claims U.S. Cyberattack Targeted Leading Encryption Company

China has accused U.S. intelligence agencies of carrying out a sophisticated cyberattack against one...

Critical FastCGI Library Flaw Exposes Embedded Devices to Code Execution

A severe vulnerability (CVE-2025-23016) in the FastCGI library-a core component of lightweight web server...

Viasat Modems Zero-Day Vulnerabilities Let Attackers Execute Remote Code

A severe zero-day vulnerability has been uncovered in multiple Viasat satellite modem models, including...

Obfuscation Techniques: A Key Weapon in the Ongoing War Between Hackers and Defenders

Obfuscation stands as a powerful weapon for attackers seeking to shield their malicious code...

Resilience at Scale

Why Application Security is Non-Negotiable

The resilience of your digital infrastructure directly impacts your ability to scale. And yet, application security remains a critical weak link for most organizations.

Application Security is no longer just a defensive play—it’s the cornerstone of cyber resilience and sustainable growth. In this webinar, Karthik Krishnamoorthy (CTO of Indusface) and Phani Deepak Akella (VP of Marketing – Indusface), will share how AI-powered application security can help organizations build resilience by

Discussion points


Protecting at internet scale using AI and behavioral-based DDoS & bot mitigation.
Autonomously discovering external assets and remediating vulnerabilities within 72 hours, enabling secure, confident scaling.
Ensuring 100% application availability through platforms architected for failure resilience.
Eliminating silos with real-time correlation between attack surface and active threats for rapid, accurate mitigation

More like this

China Claims U.S. Cyberattack Targeted Leading Encryption Company

China has accused U.S. intelligence agencies of carrying out a sophisticated cyberattack against one...

Critical FastCGI Library Flaw Exposes Embedded Devices to Code Execution

A severe vulnerability (CVE-2025-23016) in the FastCGI library-a core component of lightweight web server...

Viasat Modems Zero-Day Vulnerabilities Let Attackers Execute Remote Code

A severe zero-day vulnerability has been uncovered in multiple Viasat satellite modem models, including...