Skip to content

Attackers can exploit CSP to block requests to legitimate domains #792

@MartijnCuppens

Description

@MartijnCuppens

If an attacker executes the following js, it can restrict all request to only polyfil.io:

document.head.insertAdjacentHTML(
  "beforeend",
  `<meta http-equiv="Content-Security-Policy" content="default-src polyfil.io">`,
);

Is there any way to avoid this from happening?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions