Skip to content

Commit 8455460

Browse files
committed
add test ensuring non-workflow SVGs aren't allowed
1 parent e80056d commit 8455460

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/test/package.test.ts

+9
Original file line numberDiff line numberDiff line change
@@ -1625,6 +1625,15 @@ describe('MarkdownProcessor', () => {
16251625
assert(file);
16261626
});
16271627

1628+
it('should prevent SVG from a GitHub repo in image tag', async() => {
1629+
const manifest = { name: 'test', publisher: 'mocha', version: '0.0.1', engines: Object.create(null), repository: 'https://github.com/username/repository' };
1630+
const contents = `![title](https://github.com/eviluser/evilrepo/blob/master/malicious.svg)`;
1631+
const processor = new ReadmeProcessor(manifest, {});
1632+
const readme = { path: 'extension/readme.md', contents };
1633+
1634+
await throws(() => processor.onFile(readme));
1635+
});
1636+
16281637
it('should prevent SVGs from not trusted sources in img tags', async () => {
16291638
const manifest = { name: 'test', publisher: 'mocha', version: '0.0.1', engines: Object.create(null), repository: 'https://github.com/username/repository' };
16301639
const contents = `<img src="https://foo/hello.svg" />`;

0 commit comments

Comments
 (0)