Skip to content

Add note about the importance of preventing nonce exfiltration/reuse #258

@arturjanc

Description

@arturjanc

Implementing nonce-source and features such as 'strict-dynamic' makes it possible for authors to deploy policies based on nonces; however, for the mechanism to be useful the browser has to additionally implement protections against exfiltration and reuse of nonces.

The two features that are critical here are:

  1. Hiding nonce attribute values from the DOM (Hide nonce content attribute values. (#2369) whatwg/html#2373) to prevent exfiltration via CSS injection and related techniques.
  2. Preventing nonce hijacking by detecting <script or <style substrings in attributes of <script> elements as described in https://w3c.github.io/webappsec-csp/#is-element-nonceable and Prevent nonce stealing by looking for "<script" in attributes of nonced scripts #98

We should add a section which summarizes the extra work that has to be done in the user-agent to prevent nonce exfiltration and reuse attacks, and thus allow nonce-based policies to be effective. This should likely be referenced somewhere close to https://w3c.github.io/webappsec-csp/#strict-dynamic-usage or https://w3c.github.io/webappsec-csp/#directive-script-src (where nonces are first mentioned), or both.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions