AllOrigins, read from the source
We wrote earlier about replacing api.allorigins.win when it started timing out under load. This time we read the code behind it, app.js and the three files under app/ that handle a request end to end, instead of going by the README. Two things stood out: a CORS header pairing that only half-works the way it looks like it should, and a target URL that reaches the upstream fetch with no scheme or address check at all.
Disclosure: corsproxy.dev is our product. Everything below about AllOrigins comes from its own MIT-licensed GitHub repository — app.js, app/process-request.js, app/get-page.js and app/http-client.js at version 2.5.2, the version in package.json on the date above. The most recent commit on the default branch at the time of writing is from October 17, 2021.
What it is
AllOrigins is an Express app with one route: every HTTP method on /:format is handled by processRequest. The :format segment is really a query-string switch rather than a path parameter in the usual sense: /get?url=... and /raw?url=... are the two documented shapes, and we covered how they differ in the migration post. app.js also sets the version string from package.json into a global, disables x-powered-by, makes routing case-insensitive, and sets trust proxy, before handing every request to process-request.js.
Access-Control-Allow-Origin reflects the caller, and Allow-Credentials is always true
The CORS headers are set once, in app.js, ahead of the route handler:
res.header('Access-Control-Allow-Origin', req.headers.origin || '*')
res.header('Access-Control-Allow-Credentials', true)
res.header(
'Access-Control-Allow-Headers',
'Origin, X-Requested-With, Content-Type, Content-Encoding, Accept'
)
res.header(
'Access-Control-Allow-Methods',
'OPTIONS, GET, POST, PATCH, PUT, DELETE'
)
When a browser sends an Origin header, AllOrigins reflects that exact value back in Access-Control-Allow-Origin, paired unconditionally with Access-Control-Allow-Credentials: true. Unlike a literal * next to Allow-Credentials: true, which browsers reject outright, a reflected, specific origin next to Allow-Credentials: true passes the browser's check. Any site can send a credentials: 'include' request to api.allorigins.win and read the response.
What that actually exposes depends on whether AllOrigins has anything worth protecting behind a cookie, and from what we read in get-page.js and http-client.js, it doesn't forward the caller's own request headers (Cookie, Authorization, or anything else) to the proxied target at all. The only header http-client.js sets on the outbound request is a user agent. So this pairing can't be used to steal a session cookie the browser would otherwise send to whatever url= points at; AllOrigins never sends that cookie anywhere. The exposure is narrower: whatever cookie-based state api.allorigins.win itself might ever set on its own domain would be readable, with credentials, by any page on the web. We didn't find the service setting one today — it's stateless and keyless — but the header pairing would make it unsafe the moment it did, which is exactly the anti-pattern the credentials spec exists to catch.
When no Origin header is present, the fallback kicks in: Access-Control-Allow-Origin becomes the literal *, still next to Access-Control-Allow-Credentials: true. That specific combination is the one browsers do reject, so a credentialed request with no Origin header (not something a normal cross-origin fetch would produce) would fail the browser's own check regardless.
The upstream status code never becomes the response's status code
process-request.js has no scheme for passing an upstream's HTTP status through to the caller on the default (JSON) format. The status arrives inside the JSON body instead, alongside a response_time field, while the HTTP response itself stays whatever Express's default is for that handler. We confirmed this behavior change in practice while writing the migration post: an upstream 404 arrives as a 200 with the error inside the JSON, which means code written against fetch(...).ok or a status-code switch needs to unwrap the body first. The raw format skips that wrapping and returns the upstream body with its own Content-Length and Content-Type headers, but only when the fetch didn't itself error — an upstream error status with raw falls back to the JSON error shape too.
The same handler also wraps the JSON body in a callback(...) call when a callback query parameter is present — CORS proxies predating widespread CORS support often kept a JSONP fallback this way. A JSONP response executes as a <script> tag rather than being read as data, so anything the proxied page returns runs with the including page's full privileges; that's a property of JSONP itself, not something specific to AllOrigins's implementation of it.
Nothing checks the target URL before the fetch
get-page.js passes the url query parameter straight into got(url, options), where options is just { method, decompress }:
const options = {
method: requestMethod,
decompress: !raw,
}
There's no check anywhere in get-page.js or http-client.js for the URL's scheme, and no block list for localhost, loopback, link-local, or cloud-metadata addresses. http-client.js builds the got instance with agentkeepalive agents and a shared in-memory cache, but sets no timeout, no followRedirect/max-redirect option, and no response-size cap. Whatever behavior got has for those by default is whatever AllOrigins gets, since none of it is overridden here. That's the same gap we found reading CORSflare and cloudflare-cors-anywhere: a target taken from the query string with no address check before the request leaves the server. See our SSRF glossary entry and what gets past this kind of check for why that matters for a server that can reach internal addresses the caller's browser can't.
One more detail worth flagging as a quirk rather than a security issue: the cache setup in http-client.js guards itself with if (process.env.ENABLE_REDIS === '1' || true). The || true means that branch always runs regardless of the environment variable, so the in-memory QuickLRU cache (capped at 1,000 entries) is always on; there's no way to disable it through that flag as written.
Where the defaults differ
| AllOrigins | corsproxy.dev | |
|---|---|---|
| Origin + credentials on the response | Reflected origin (or * with no Origin header) paired with Allow-Credentials: true, always | Always *; Allow-Credentials never sent |
| Upstream status code | Embedded in the JSON body on the default format; the HTTP response isn't the upstream's status | Returned as the upstream's own status code |
| Target URL check | None in the code we read: no scheme check, no private/loopback/metadata block list | Private/loopback/metadata addresses blocked via DNS-over-HTTPS resolution before the fetch |
| Caller's own headers to the target | Not forwarded — only a configured user agent reaches the upstream | Stripped by default; can be added back per request with reqHeaders or managed upstream headers |
| Accounts, keys, quotas | None — no keys, no per-caller limit | Per-account daily quota, enforced atomically in a Durable Object |
If you're already running it
AllOrigins is open source, so the fixes are local changes, not a reason to rule it out. Compute Access-Control-Allow-Origin against an allowlist you control instead of reflecting whatever Origin arrives, and only set Access-Control-Allow-Credentials if you've actually put something behind a cookie on that domain. Add a scheme and address check in get-page.js before the call to got — reject anything that isn't http/https, and resolve the hostname to confirm it isn't private, loopback, or link-local before fetching it. Both are a few lines in files that already exist; neither requires forking the request-handling structure.
Try it
If you'd rather not patch someone else's proxy, get a free corsproxy.dev key — private and loopback targets are blocked before the fetch, and the upstream's status code is the response's status code.