Skip to content

navigation requests blocked by require-trusted-types-for don't set a violation sample #584

@fred-wang

Description

@fred-wang

From 4.2.4. Should navigation request of type be blocked by Content Security Policy?, step 2.1.1 will execute the 4.3.1.1. require-trusted-types-for Pre-Navigation check. Step 4 is as follows:

Let convertedScriptSource be the result of executing Process value with a default policy algorithm, with the following arguments:

  • TrustedScript as expectedType
  • request’s clients's global object as global
  • encodedScriptSource as input
  • "Location href" as sink
  • If that algorithm threw an error or convertedScriptSource is not a TrustedScript object, return "Blocked" and abort further steps.

When "Blocked" is returned to 4.2.4. Should navigation request of type be blocked by Content Security Policy?, the algo continues by creating a violation object and reporting it.

I don't see any place where violation's sample is actually set, but trusted-types/trusted-types-navigation.html expects it to starts with the sink name "Location href" similar to 4.3.4. Should sink type mismatch violation be blocked by Content Security Policy? and that's what Chromium seems to implement.

cc @koto @otherdaniel @lukewarlow @smaug----

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