Skip to content

Commit 78dea55

Browse files
crisbetomattrbeck
authored andcommitted
fix(compiler): disallow translations of iframe src
Fixes that the compiler was allowing translations of `src` attributes in iframes which can be a security issue.
1 parent de0eb4c commit 78dea55

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/compiler/src/schema/trusted_types_sinks.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* tags use '*'.
1212
*
1313
* Extracted from, and should be kept in sync with
14-
* https://w3c.github.io/webappsec-trusted-types/dist/spec/#integrations
14+
* https://www.w3.org/TR/trusted-types/#integrations
1515
*/
1616
const TRUSTED_TYPES_SINKS = new Set<string>([
1717
// NOTE: All strings in this set *must* be lowercase!
@@ -25,6 +25,7 @@ const TRUSTED_TYPES_SINKS = new Set<string>([
2525

2626
// TrustedScriptURL
2727
'embed|src',
28+
'iframe|src',
2829
'object|codebase',
2930
'object|data',
3031
]);

packages/compiler/test/schema/trusted_types_sinks_spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ describe('isTrustedTypesSink', () => {
1313
expect(isTrustedTypesSink('iframe', 'srcdoc')).toBeTrue();
1414
expect(isTrustedTypesSink('p', 'innerHTML')).toBeTrue();
1515
expect(isTrustedTypesSink('embed', 'src')).toBeTrue();
16+
expect(isTrustedTypesSink('iframe', 'src')).toBeTrue();
1617
expect(isTrustedTypesSink('a', 'href')).toBeFalse();
1718
expect(isTrustedTypesSink('base', 'href')).toBeFalse();
1819
expect(isTrustedTypesSink('div', 'style')).toBeFalse();

0 commit comments

Comments
 (0)