> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# config-cors-credentials-any-origin

> A web server or hosting config sends Access-Control-Allow-Credentials: true with a wildcard or echoed request origin.

## What it flags

Nginx `add_header`, Apache `Header set`, `vercel.json` headers, `netlify.toml` `[headers.values]` and `_headers` blocks that send `Access-Control-Allow-Credentials: true` together with `Access-Control-Allow-Origin: *`, or, in Nginx, with `$http_origin` copied from the request. Both headers must be set in the same block, location, section or path rule.

Browsers reject the literal `*` with credentials, so that pair is a broken policy rather than an open one; it is reported because the common workaround, echoing the request origin, lets any site read credentialed responses. An echoed `$http_origin` is not reported inside an `if` that compares it with `=` or with a regex anchored at both ends (`^https://app\.example\.com$`), inside an `if` on a variable set only for such an origin, or after an `if` with the negated check that returns for every other origin. A presence test such as `if ($http_origin)`, an unanchored regex and a `.*` or `.+` not followed by `\.` (`^https://.*example\.com$` or `^https://.*$`) do not count. A header set to the output of a `map $http_origin` is reported when the map's default or an unanchored entry copies `$http_origin`, and a map does not protect headers that do not use its output. [MDN: CORS credentials](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#credentialed_requests_and_wildcards)

```nginx theme={null}
add_header Access-Control-Allow-Origin https://app.example.com always;
add_header Access-Control-Allow-Credentials true always;
```

No automatic fix: a human decides.

## Configuration

Set the rule to `"off"` in `loadwise.config.json` to drop its findings:

```json theme={null}
{
  "rules": { "config-cors-credentials-any-origin": "off" }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.