Documentation

Injected scripts calling AWS API Gateway

Some injected scripts and extensions send data to an AWS API Gateway default host, and your CSP reports each request. This rule recognizes those violations. It is off for now: these violations appear in your lists and notify as usual while we check what the rule would hide.

State: Off

What it matches

CSP violations with both of these traits:

  • The blocked address is on an API Gateway default host: https://<id>.execute-api.<region>.amazonaws.com
  • The directive is connect-src, script-src or script-src-elem

An image from the same host, a host that only looks like API Gateway, and the eval violation that often arrives in the same burst are not matched.

Why it's noise

Scripts your site never loads make these requests: extensions and other software inject them into your visitors' pages. An app of yours that calls API Gateway through a custom domain never uses a default host.

What it can hide

The rule matches the host only, not who made the request. With the rule on, it would also hide:

  • Your own API Gateway on its default host, when your connect-src is missing it. Under an enforcing policy your frontend's calls fail; under Content-Security-Policy-Report-Only they work but will fail once you enforce. Either way, the violations that would tell you so are filtered.
  • A skimmer that sends form data to an API Gateway host. Under an enforcing policy the browser blocked the request. Under Content-Security-Policy-Report-Only the request went through and the form data left the page: the report is the only trace, and it would be filtered. You would find it only under Show filtered, not in your issue list.

If your app calls API Gateway, use a custom domain for it, or check the filtered reports for your own API's id.

See the filtered reports

While the rule is off, these violations appear in your lists like any other. Once it is on, pick Show filtered on the Issues or Reports list, or pass include_filtered: true over MCP; each report's noise_rule names aws-execute-api-injection. See Noise Rules.