> ## 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.

# cors-origin-regex-unanchored

> A CORS origin regex also accepts look-alike hosts.

## What it flags

CORS `origin` regexes, and regex `.test` calls on the request origin, whose host can be prefixed (no `^`, `//` or `\.` before it), extended (no `$` after it) or has an unescaped dot. URL values passed to `new RegExp` count too. Without credentials it is contextual. The fix anchors and escapes a single-branch literal and needs review.

## Configuration

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

```json theme={null}
{
  "rules": { "cors-origin-regex-unanchored": "off" }
}
```


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