Skip to content

Commit 5215a50

Browse files
committed
allowing style tag
1 parent 7fdf1ef commit 5215a50

File tree

5 files changed

+22
-3
lines changed

5 files changed

+22
-3
lines changed

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
`maven-publish`
44
signing
55
jacoco
6-
id("pl.allegro.tech.build.axion-release") version "1.10.0"
6+
id("pl.allegro.tech.build.axion-release") version "1.12.0"
77
id("com.adarshr.test-logger") version "1.6.0"
88
id("org.sonarqube") version "2.8"
99
}
@@ -15,7 +15,7 @@ repositories {
1515

1616
dependencies {
1717
implementation("com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:20190610.1")
18-
testImplementation("org.junit.jupiter:junit-jupiter:5.4.2")
18+
testImplementation("org.junit.jupiter:junit-jupiter:5.6.2")
1919
}
2020

2121
group = "com.github.bgalek.security.svg"

src/main/java/com/github/bgalek/security/svg/SvgSecurityValidator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ private static Set<String> getOffendingElements(String xml) {
8989
"radialgradient",
9090
"rect",
9191
"stop",
92+
"style",
9293
"switch",
9394
"symbol",
9495
"text",

src/test/java/com/github/bgalek/security/svg/SvgSecurityValidatorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
class SvgSecurityValidatorTest {
1616

1717
@ParameterizedTest(name = "validate {0} svg")
18-
@ValueSource(strings = {"hacked/with-onclick-attribute.svg", "hacked/with-script-tag.svg"})
18+
@ValueSource(strings = {"hacked/with-onclick-attribute.svg", "hacked/with-script-tag.svg", "hacked/with-script-tag-in-styles.svg"})
1919
void shouldDetectXssInFiles(String file) {
2020
ValidationResult detect = new SvgSecurityValidator().validate(loadFile(file));
2121
assertEquals(1, detect.getOffendingElements().size());
Lines changed: 10 additions & 0 deletions
Loading
Lines changed: 8 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)