Skip to main content
Menu
Advisories

Dynoxide: permissive CORS on the DynamoDB HTTP listener allows cross-origin access to the local database

GHSA-9HQG-J4P2-JJ98Published Updated GitHub

Description

dynoxide serve answered a CORS preflight from any origin with Access-Control-Allow-Origin: *, and it never verifies request signatures. While the server was running, any web page open in the same browser could list, read, write and delete tables with ordinary fetch() calls. The listener did not check the Host header either, so a DNS-rebinding page could do the same without CORS.

This is the DynamoDB listener, on port 8000 by default. The MCP listener was hardened against the same attacks in GHSA-fvh2-gm75-j4j7 and was not affected.

Who is affected

Anyone who runs the Dynoxide HTTP server on a machine where they also browse the web: the dynoxide binary, the npm, PyPI and Composer packages, the container images when the port is published to the host, and Rust programs that start the server with dynoxide::server. Embedding the engine as a library without starting the server is not affected.

Every release from 0.9.5 to 1.8.1 is affected (crate dynoxide-rs 0.9.5 to 4.1.1), apart from the back-ported 0.9.14, 0.12.1 and 0.13.1. This was confirmed by running the 0.9.5, 0.9.13, 1.4.0 and 1.8.1 release binaries.

What changed in 1.8.2

  • A request with an Origin header is served only when the origin is a loopback one: http or https, host localhost, 127.0.0.1 or [::1], any port. Every other origin, including null, gets a 403 before any operation runs.
  • A request with no Origin header is served as before. SDKs, the AWS CLI and other non-browser clients send none.
  • --cors-allow-origin <origin> allows a further origin and can be repeated. --cors-allow-origin '*' restores the old behaviour for people who need it and understand what it opens.
  • Rust embedders set the same thing with ServerOptions::with_allowed_origins and server::serve_with_options (crate 4.2.0).

This is a deliberate difference from DynamoDB, which answers every origin. DynamoDB can do that because it verifies every signature. Dynoxide does not, so the browser's origin is the only thing that tells a local page from a hostile one.

What is not changed

  • The Host header is still not checked. A loopback-only Host rule would break Docker port mappings reached by service name, CI service containers and host.docker.internal. Browsers send Origin on every POST, and every Dynoxide operation is a POST, so a rebound page is refused by its origin.
  • GET / still returns its health line to a rebound page, because a same-origin GET carries no Origin. The line holds no data.
  • Any page served from a loopback port is trusted.
  • A process on the machine that is not a browser is not stopped by any of this.

Upgrading

Upgrade to 1.8.2 (crate 4.2.0). Three older lines have the same fix: 0.9.14, 0.12.1 and 0.13.1, on both npm and crates.io, so a project on a ^0.9, ^0.12 or ^0.13 range gets it from an ordinary update. No other older line receives the fix; from anything else, move to the current release.

If you can't upgrade yet, stop the server when you are not using it, or put a proxy in front of it that drops requests carrying an Origin you do not expect.

Credit

Reported by @hgrgr.

Affected versions

References

GitHub · nubo-db/dynoxide