Cleanup after code review feedback

This commit is contained in:
Jonathan Leitschuh
2022-03-04 15:35:01 -05:00
parent 5243fe3dbf
commit 523ddb79f3
2 changed files with 6 additions and 6 deletions

View File

@@ -2,11 +2,11 @@
import semmle.code.java.Type
private import semmle.code.java.dataflow.FlowSteps
library class TypeProperty extends Class {
class TypeProperty extends Class {
TypeProperty() { hasQualifiedName("java.util", "Properties") }
}
library class PropertiesGetPropertyMethod extends ValuePreservingMethod {
class PropertiesGetPropertyMethod extends ValuePreservingMethod {
PropertiesGetPropertyMethod() {
getDeclaringType() instanceof TypeProperty and
hasName("getProperty")
@@ -15,21 +15,21 @@ library class PropertiesGetPropertyMethod extends ValuePreservingMethod {
override predicate returnsValue(int arg) { arg = 1 }
}
library class PropertiesGetMethod extends Method {
class PropertiesGetMethod extends Method {
PropertiesGetMethod() {
getDeclaringType() instanceof TypeProperty and
hasName("get")
}
}
library class PropertiesSetPropertyMethod extends Method {
class PropertiesSetPropertyMethod extends Method {
PropertiesSetPropertyMethod() {
getDeclaringType() instanceof TypeProperty and
hasName("setProperty")
}
}
library class PropertiesStoreMethod extends Method {
class PropertiesStoreMethod extends Method {
PropertiesStoreMethod() {
getDeclaringType() instanceof TypeProperty and
(getName().matches("store%") or getName() = "save")

View File

@@ -4,5 +4,5 @@ category: minorAnalysis
* Add new guards `IsWindowsGuard`, `IsSpecificWindowsVariant`, `IsUnixGuard`, and `IsSpecificUnixVariant` to detect OS specific guards.
* Add new predicate `getSystemProperty` that gets all expressions that retrieve system properties from a variety of sources (eg. alternative JDK API's, Google Guava, Apache Commons, Apache IO, ect..).
* Update "Local information disclosure in a temporary directory" (`java/local-temp-file-or-directory-information-disclosure`) to remove false-positives when OS is properly used as logical guard.
* Update "Local information disclosure in a temporary directory" (`java/local-temp-file-or-directory-information-disclosure`) to use `getSystemProperty` to resolve more
* Update "Local information disclosure in a temporary directory" (`java/local-temp-file-or-directory-information-disclosure`) to use `getSystemProperty` to use new `getSystemProperty` predicate.