Skip to content
This repository has been archived by the owner on Jul 25, 2019. It is now read-only.

Commit

Permalink
test: add xss scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
juanpicado committed May 15, 2019
1 parent 8c4639e commit b211b97
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/readme.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,18 @@ describe('readme', () => {
expect(parseReadme('![Escape SRC - onerror]("onerror="alert(\'ImageOnError\'))')).toEqual('<p><img src="%22onerror=%22alert(\'ImageOnError\')" alt="Escape SRC - onerror"></p>');
});
});

describe('should test fuzzing', () => {
test('xss / document cookie', () => {
expect(parseReadme('[XSS](javascript:prompt(document.cookie))')).toEqual('<p>XSS</p>');
});

test('xss / white space cookie', () => {
expect(parseReadme('[XSS](j a v a s c r i p t:prompt(document.cookie))')).toEqual('<p>[XSS](j a v a s c r i p t:prompt(document.cookie))</p>');
});

test('xss / white space cookie', () => {
expect(parseReadme('[XSS](data:text/html;base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4K)')).toEqual('<p>XSS</p>');
});
});
});

0 comments on commit b211b97

Please sign in to comment.