diff --git a/packages/@glimmer-workspace/integration-tests/test/attributes-test.ts b/packages/@glimmer-workspace/integration-tests/test/attributes-test.ts
index eef13f25c13..3b846e11365 100644
--- a/packages/@glimmer-workspace/integration-tests/test/attributes-test.ts
+++ b/packages/@glimmer-workspace/integration-tests/test/attributes-test.ts
@@ -573,6 +573,58 @@ export class AttributesTests extends RenderTest {
this.assertHTML('');
this.assertStableNodes();
}
+
+ @test
+ 'svg a[href] marks javascript: protocol as unsafe'() {
+ this.render('', { foo: 'javascript:foo()' });
+ let anchor = (this.element.firstChild as SimpleElement).firstChild as SimpleElement;
+ this.assert.strictEqual(this.readDOMAttr('href', anchor), 'unsafe:javascript:foo()');
+
+ this.rerender({ foo: 'http://foo.bar' });
+ this.assert.strictEqual(this.readDOMAttr('href', anchor), 'http://foo.bar');
+ }
+
+ @test
+ 'svg a[xlink:href] marks javascript: protocol as unsafe'() {
+ this.render('', { foo: 'javascript:foo()' });
+ let anchor = (this.element.firstChild as SimpleElement).firstChild as SimpleElement;
+ this.assert.strictEqual(this.readDOMAttr('xlink:href', anchor), 'unsafe:javascript:foo()');
+
+ this.rerender({ foo: 'http://foo.bar' });
+ this.assert.strictEqual(this.readDOMAttr('xlink:href', anchor), 'http://foo.bar');
+ }
+
+ @test
+ 'marks data: urls as unsafe on iframe[src] and object[data]'() {
+ this.render('', {
+ foo: 'data:text/html,',
+ });
+ this.assertHTML('');
+ this.assertStableRerender();
+
+ this.rerender({ foo: 'https://example.com/page' });
+ this.assertHTML('');
+ this.assertStableNodes();
+ }
+
+ @test
+ 'object[data] marks data: and javascript: urls as unsafe but allows http'() {
+ this.render('', {
+ foo: 'data:text/html,',
+ });
+ this.assertHTML('');
+
+ this.rerender({ foo: 'javascript:foo()' });
+ this.assertHTML('');
+
+ // the allowed URL must be same-origin and actually loadable: Safari 15
+ // hangs (and times out the BrowserStack run) when an