Skip to content

SH009: Laravel CORS allows every origin

Severity: medium · Category: security · Applies to: laravel

Why it matters

A wildcard origin lets any website call your API from a visitor's browser. With supports_credentials enabled it can act on behalf of logged-in users.

How to fix

List the allowed origins in config/cors.php instead of '*'.

Ignoring this rule

Skip it everywhere in devshield.yml:

ignore:
  - SH009

Or skip one line with a comment on that line or the line above:

devshield-ignore: SH009