Skip to content

SONARSEC-6265 Modify rules S2091, S5145, S6390, S6547: align lib names and cleanup #4982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/header_names/allowed_framework_names.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
* Java JDBC API
* Java I/O API
* Java Lang Package
* Java Logging API
* Java JNDI API
* Java Regex API
* Java XML API
Expand Down
6 changes: 3 additions & 3 deletions rules/S2091/kotlin/how-to-fix-it/java-xml.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import javax.xml.xpath.XPath
import javax.xml.xpath.XPathConstants

fun authenticate(request: HttpServletRequest, xpath: XPath, doc: Document): Boolean {
val user: String = request.getParameter("user")
val pass: String = request.getParameter("pass")
val user = request.getParameter("user")
val pass = request.getParameter("pass")
val expression = "/users/user[@name='$user' and @pass='$pass']"
return xpath.evaluate(expression, doc, XPathConstants.BOOLEAN) as Boolean
}
Expand All @@ -28,7 +28,7 @@ import javax.xml.xpath.XPath
import javax.xml.xpath.XPathConstants
import javax.xml.xpath.XPathVariableResolver

fun authenticate(request: HttpServletRequest, xpath: XPath, doc: Document?): Boolean {
fun authenticate(request: HttpServletRequest, xpath: XPath, doc: Document): Boolean {
val user = request.getParameter("user")
val pass = request.getParameter("pass")
val expression = "/users/user[@name=\$user and @pass=\$pass]"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
== How to fix it in Java SE
== How to fix it in Java Logging API

=== Code examples

Expand Down
2 changes: 1 addition & 1 deletion rules/S5145/java/rule.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include::../impact.adoc[]

// How to fix it section

include::how-to-fix-it/java-se.adoc[]
include::how-to-fix-it/java-logging.adoc[]

== Resources

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
== How to fix it in Java SE
== How to fix it in Java Logging API

=== Code examples

Expand Down
2 changes: 1 addition & 1 deletion rules/S5145/kotlin/rule.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ include::../rationale.adoc[]

include::../impact.adoc[]

include::how-to-fix-it/java-se.adoc[]
include::how-to-fix-it/java-logging.adoc[]

== Resources

Expand Down
10 changes: 1 addition & 9 deletions rules/S6384/java/rule.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,7 @@ ifdef::env-github,rspecator-view[]
== Implementation Specification
(visible only on this page)

=== Message

Change this code to not perform arbitrary intent redirection.

include::../message.adoc[]

endif::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

include::../message.adoc[]
9 changes: 1 addition & 8 deletions rules/S6384/kotlin/rule.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,8 @@ ifdef::env-github,rspecator-view[]
== Implementation Specification
(visible only on this page)

=== Message

Change this code to not perform arbitrary intent redirection.
include::../message.adoc[]


endif::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

include::../message.adoc[]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
== How to fix it in Java SE
== How to fix it in Java Lang Package

=== Code examples

Expand Down
2 changes: 1 addition & 1 deletion rules/S6390/java/rule.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ might badly answer, be slowed down, or become completely irresponsive.

// How to fix it section

include::./how-to-fix-it/java-se.adoc[]
include::./how-to-fix-it/java-lang.adoc[]

== Resources

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
== How to fix it in Java SE
== How to fix it in Java Lang Package

=== Code examples

Expand Down
2 changes: 1 addition & 1 deletion rules/S6390/kotlin/rule.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ might badly answer, be slowed down, or become completely irresponsive.

// How to fix it section

include::./how-to-fix-it/java-se.adoc[]
include::./how-to-fix-it/java-lang.adoc[]

== Resources

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
== How to fix it in Java SE
== How to fix it in Java Lang Package

=== Code examples

Expand Down
2 changes: 1 addition & 1 deletion rules/S6547/java/rule.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include::../impact.adoc[]

// How to fix it section

include::how-to-fix-it/java-se.adoc[]
include::how-to-fix-it/java-lang.adoc[]

== Resources

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
== How to fix it in Java SE
== How to fix it in Java Lang Package

=== Code examples

Expand Down
2 changes: 1 addition & 1 deletion rules/S6547/kotlin/rule.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include::../impact.adoc[]

// How to fix it section

include::how-to-fix-it/java-se.adoc[]
include::how-to-fix-it/java-lang.adoc[]

== Resources

Expand Down
Loading