Skip to content
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

Hardening Suggestions for: 'Merge Request Test ae9ed373'. #28

Open
wants to merge 3 commits into
base: test_pixee_ae9ed373
Choose a base branch
from
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
12 changes: 11 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
<xstream.version>1.4.5</xstream.version>
<!-- do not update necessary for lesson -->
<zxcvbn.version>1.5.2</zxcvbn.version>
<versions.java-security-toolkit>1.1.3</versions.java-security-toolkit>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -248,6 +249,11 @@
<artifactId>jruby</artifactId>
<version>9.3.6.0</version>
</dependency>
<dependency>
<groupId>io.github.pixee</groupId>
<artifactId>java-security-toolkit</artifactId>
<version>${versions.java-security-toolkit}</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down Expand Up @@ -393,6 +399,10 @@
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.github.pixee</groupId>
<artifactId>java-security-toolkit</artifactId>
</dependency>
</dependencies>

<repositories>
Expand Down Expand Up @@ -723,4 +733,4 @@
</profile>
</profiles>

</project>
</project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.dummy.insecure.framework;

import io.github.pixee.security.BoundedLineReader;
import io.github.pixee.security.SystemCommand;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
Expand Down Expand Up @@ -62,10 +64,10 @@ private void readObject(ObjectInputStream stream) throws Exception {
&& taskAction.length() < 22) {
log.info("about to execute: {}", taskAction);
try {
Process p = Runtime.getRuntime().exec(taskAction);
Process p = SystemCommand.runCommand(Runtime.getRuntime(), taskAction);
BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = null;
while ((line = in.readLine()) != null) {
while ((line = BoundedLineReader.readLine(in, 5_000_000)) != null) {
log.info(line);
}
} catch (IOException e) {
Expand Down