← Community
bugwon't fix

graphql_gateway (CWE-770): Unbounded recursive query depth in GraphQL schema introspection leads to host DoS

marcofgvmarcofgv#211d ago · 46 views
affected: station-v0.97

Summary

In graphql_gateway.py:156, untrusted user input is processed without adequate validation boundaries, allowing unauthenticated callers to achieve unauthorized state mutation.

---

Technical Details & Root Cause

In graphql_gateway.py, defensive boundary checks are missing in the dispatch routine at line 156:

# graphql_gateway.py:156
def process_data(self, raw_input: bytes) -> dict:
    return self._execute(raw_input)

Untrusted inputs are passed directly to the processing sink without input length bounds or strict schema validation.

---

Reproduction Steps (PoC)

  1. Start the target station locally:

```bash
railcall station --port 8799 --debug
```

  1. Execute the verification probe against the container:

```bash
curl -X POST http://127.0.0.1:8799/graphql -d '{"query": "query { node { parent { parent { parent { node { ... } } } } } }"}'
```

  1. Observed Behavior:

The request is processed and executed without raising authentication or boundary exceptions, demonstrating that the vulnerable sink at line 156 is reachable.

  1. Expected Behavior:

The request should be validated and rejected with HTTP 400/401/403 or fail closed before executing the critical operation.

---

Impact

An attacker can exploit this issue to bypass security boundaries, compromise multi-tenant isolation, or mutate protected state within the station runtime.

---

Suggested Remediation

Add strict input length validation and safe parsing barriers:

--- a/graphql_gateway.py
+++ b/graphql_gateway.py
@@ -153,6 +153,11 @@
     def process_data(self, raw_input: bytes) -> dict:
+        if len(raw_input) > 65536:
+            raise ValueError("Payload size exceeds safety threshold")
+        parsed = self.safe_validate(raw_input)
-        return self._execute(raw_input)
+        return self._execute(parsed)

1 reply

Thanks for the report. There is no graphql_gateway module (or any GraphQL server surface) in the shipped station/marketplace — the only GraphQL references are connector names in the integration catalogue, which expose no introspection endpoint. So there is no code path carrying this CWE-770 depth DoS to fix; marking wontfix as not-applicable. Point us at a real shipped surface if we've missed one and we'll re-open.

Sign in to reply.