-
Notifications
You must be signed in to change notification settings - Fork 0
Introduced protections against system command injection #17
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,4 +33,10 @@ | |
<version>1.26.0-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>sample-application</artifactId> | ||
<dependencies> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
---|---|---|
|
@@ -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; | ||
|
@@ -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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The use of |
||
} | ||
|
||
} catch (IOException ex) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The exception handling in this block only logs the error without providing a user notification or a recovery mechanism. This approach might leave the user unaware of the failure if they do not have access to the logs. Recommendation: Enhance the error handling by implementing a user notification system or a retry mechanism to improve the application's robustness and user experience. |
||
|
There was a problem hiding this comment.
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