Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support running with TrustedTypes enforced #4447

Closed
wants to merge 3 commits into from

Commits on Sep 15, 2020

  1. Support running with TrustedTypes enforced.

    Trusted Types is a new Content Security Policy specification,
    currently implemented in browsers based on Chromium 83 or higher, which
    requires that data passed to APIs which may result in arbitrary code
    execution must go through an explicit policy. This helps to catch
    unintended use of dangerous APIs, and reduces the surface area for
    some security reviews.
    
    I'm not sure if test infrastructure like mocha is a likely target
    for attack – seems like in most cases an attacker could only access test
    data, and it is rare for tests to handle untrusted data. However,
    there's value for infrastructure to be compatible with running with
    Trusted Types enabled, as it will allow users to write tests to ensure
    that the code under test can run with Trusted Types.
    
    This change creates and applies policies for the two places in mocha
    that call innerHTML, and adds a temporary patch to the rollup build.
    With those changes in place, we can run mocha's karma tests with
    Trusted Types enabled (save for the one test that runs with requirejs,
    which relies on eval).
    
    More info:
    
    * Spec: https://w3c.github.io/webappsec-trusted-types/dist/spec/#introduction
    * Related PR adding support to karma: karma-runner/karma#3360
    rictic committed Sep 15, 2020
    Configuration menu
    Copy the full SHA
    614e23d View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2020

  1. Configuration menu
    Copy the full SHA
    35511d0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    095bc91 View commit details
    Browse the repository at this point in the history