Skip to content

Commit 9cc2543

Browse files
authored
Warn about DoS attacks (#301)
Signed-off-by: Matteo Collina <[email protected]>
1 parent bc97bef commit 9cc2543

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ You can use it as is without passing any option or you can configure it as expla
7676
* `strictPreflight`: Enforces strict requirement of the CORS preflight request headers (**Access-Control-Request-Method** and **Origin**) as defined by the [W3C CORS specification](https://www.w3.org/TR/2020/SPSD-cors-20200602/#resource-preflight-requests) (the current [fetch living specification](https://fetch.spec.whatwg.org/) does not define server behavior for missing headers). Preflight requests without the required headers will result in 400 errors when set to `true` (default: `true`).
7777
* `hideOptionsRoute`: hide options route from the documentation built using [@fastify/swagger](https://github.com/fastify/fastify-swagger) (default: `true`).
7878

79+
#### :warning: DoS attacks
80+
81+
The use of `RegExp` or a `function` for the `origin` parameter might allow an attacker to perform a Denial of Service
82+
attack. Craft those with extreme care.
83+
7984
### Configuring CORS Asynchronously
8085

8186
```js

0 commit comments

Comments
 (0)