CVE-2026-5594
Received Received - Intake
Remote Code Injection in premAI-io premsql eval Function

Publication date: 2026-04-05

Last updated on: 2026-04-29

Assigner: VulDB

Description
A weakness has been identified in premAI-io premsql up to 0.2.1. Affected is the function eval of the file premsql/agents/baseline/workers/followup.py. This manipulation of the argument result causes code injection. The attack is possible to be carried out remotely. The exploit has been made available to the public and could be used for attacks. The vendor was contacted early about this disclosure but did not respond in any way.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-04-05
Last Modified
2026-04-29
Generated
2026-05-07
AI Q&A
2026-04-06
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
premai-io premsql to 0.2.1 (inc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-74 The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
CWE-94 The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
Attack-Flow Graph
AI Powered Q&A
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

The vulnerability allows remote code execution through unsafe evaluation of user-controlled input, which can lead to unauthorized access, data manipulation, or system compromise.

Such security weaknesses can impact compliance with standards and regulations like GDPR and HIPAA, which require protection of sensitive data and secure system operations to prevent unauthorized access and data breaches.

Exploitation of this vulnerability could result in violations of these regulations due to potential exposure or alteration of protected data, failure to maintain system integrity, and inadequate security controls.


How can this vulnerability impact me? :

This vulnerability allows an attacker to execute arbitrary code on the server hosting the vulnerable premsql service remotely. This can lead to full compromise of the server, including unauthorized access, data theft, data manipulation, or disruption of service.

Because the attacker can run any system command, they could install malware, create backdoors, or pivot to other parts of the network, severely impacting the security and integrity of your systems.


Can you explain this vulnerability to me?

CVE-2026-5594 is a remote code execution vulnerability in the premAI-io premsql library (up to version 0.2.1). It occurs because the application unsafely uses Python's eval() function on the raw output of a language model (LLM) without proper validation. Specifically, the eval() function is called on a string returned by the LLM after replacing JSON null with Python None. An attacker can exploit this by injecting malicious code into the LLM's output, which is then executed on the server.

The vulnerability is located in the function eval of the file premsql/agents/baseline/workers/followup.py. By sending crafted input (prompt injection), an attacker can manipulate the LLM to output arbitrary Python code, which the server executes, leading to remote code execution.

A proof-of-concept exploit demonstrates this by sending a JSON payload that causes the server to execute system commands such as launching the calculator application (calc) on Windows.


How can this vulnerability be detected on my network or system? Can you suggest some commands?

This vulnerability can be detected by attempting to exploit the remote code execution flaw using crafted HTTP POST requests to the vulnerable service endpoint `/completion` on port 1111.

A proof-of-concept Python script sends two requests: first a benign JSON payload to initialize the service, then a crafted JSON payload that injects Python code to be executed on the server.

Detection involves sending a payload that attempts to execute a harmless system command, such as launching the calculator application (`calc`), and then verifying if the command was executed on the server.

  • Use the provided PoC Python script which sends HTTP POST requests with JSON payloads to `http://127.0.0.1:1111/completion`.
  • Check the server for side effects of the injected command, for example, if the calculator application (`calc`) is launched on a Windows server.

What immediate steps should I take to mitigate this vulnerability?

Immediate mitigation involves removing the unsafe use of Python's `eval()` function on untrusted input generated by the language model.

Replace the vulnerable code that uses `eval()` with safe JSON parsing methods such as `json.loads()` to parse the LLM output.

Ensure that the prompt to the language model instructs it to output valid JSON to facilitate safe parsing.

If necessary, use JSON repair tools to fix malformed JSON before parsing to avoid fallback to unsafe evaluation.

  • Patch the code from `result = eval(result.replace("null", "None"))` to `result = json.loads(result_str)`.
  • Avoid executing any code derived from untrusted input without proper validation.

Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart