Check ID: awslambda_function_url_cors_policy
Provider: AWS
Service: awslambda
Severity: MEDIUM
Categories: internet-exposed
Resource type: AwsLambdaFunction

What this check verifies

Lambda function URL CORS policy is reviewed for AllowOrigins. The presence of * indicates a wide origin allowance in the CORS configuration.

Risk

Wildcard origins allow any website to call the endpoint from a browser and read responses, weakening origin isolation. This can lead to data exposure (C) and unauthorized actions (I) if state-changing methods are reachable, enabling scripted abuse and cross-origin attacks.

Recommendation

Apply least privilege to CORS:
  • Restrict AllowOrigins to trusted domains; avoid *
  • Limit AllowMethods/AllowHeaders; disable AllowCredentials unless required
  • Prefer authenticated access (e.g., AWS_IAM) and enforce resource policies for defense in depth

Remediation

aws lambda update-function-url-config --function-name <example_resource_name> --cors AllowOrigins=https://www.example.com

References

Where this check fires

This check runs on every scheduled scan against your AWS account. Findings appear at Cloud Security → Findings filterable by Check ID = awslambda_function_url_cors_policy. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to AWS checks