Skip to content
Open
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
10 changes: 10 additions & 0 deletions page-object/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<versions.java-security-toolkit>1.2.0</versions.java-security-toolkit>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -68,4 +69,13 @@
</plugin>
</plugins>
</build>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This library holds security tools for protecting Java API calls.

License: MIT ✅ | Open source ✅ | More facts

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.github.pixee</groupId>
<artifactId>java-security-toolkit</artifactId>
<version>${versions.java-security-toolkit}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
6 changes: 6 additions & 0 deletions page-object/sample-application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,10 @@
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>sample-application</artifactId>
<dependencies>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This library holds security tools for protecting Java API calls.

License: MIT ✅ | Open source ✅ | More facts

<dependency>
<groupId>io.github.pixee</groupId>
<artifactId>java-security-toolkit</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*/
package com.iluwatar.pageobject;

import io.github.pixee.security.SystemCommand;
import java.awt.Desktop;
import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -79,7 +80,7 @@ public static void main(String[] args) {

} else {
// java Desktop not supported - above unlikely to work for Windows so try instead...
Runtime.getRuntime().exec("cmd.exe start " + applicationFile);
SystemCommand.runCommand(Runtime.getRuntime(), "cmd.exe start " + applicationFile);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using Runtime.getRuntime().exec() to execute system commands can introduce security vulnerabilities, such as command injection. This is especially risky if applicationFile can be influenced by user input. Consider using a more secure method to execute system commands, such as the ProcessBuilder class, and ensure that any user input is properly sanitized.

}

} catch (IOException ex) {
Expand Down
Loading