-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: escape the language class name so it cannot be used to inject HT…
…ML (#137) * fix: fix: escape lang to use * test: add unit test for XSS injection through the language name * test: make the XSS attack test more realistic Co-authored-by: Joshua Gleitze <dev@joshuagleitze.de>
- Loading branch information
Showing
4 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<h1>Test</h1> | ||
<p>This is a fenced code block:</p> | ||
<pre class="language-"><img/onerror="alert('hacked')"src=.><span\class=""><code class="language-"><img/onerror="alert('hacked')"src=.><span\class="">public class Foo() { | ||
public Foo(bar) { | ||
System.out.println(bar); | ||
} | ||
} | ||
</code></pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Test | ||
|
||
This is a fenced code block: | ||
|
||
```"><img/onerror="alert('hacked')"src=.><span\class=" | ||
public class Foo() { | ||
public Foo(bar) { | ||
System.out.println(bar); | ||
} | ||
} | ||
``` |