thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Application & OT Security · Advanced

Trusted Types

A browser security API that forces dangerous DOM sinks to accept only typed, policy-approved values, preventing DOM-based XSS.

Definition

Enabled via the CSP directive require-trusted-types-for 'script', it makes assignments like innerHTML throw unless the value comes from a defined policy that sanitizes it. It reduces DOM XSS attack surface to a few reviewable policies.

Example

After enabling Trusted Types, element.innerHTML = userString throws an error unless passed through a sanitizer policy.

Exam tip

Advanced DOM XSS defense delivered through CSP.

Related terms