Skip to content

Commit 0fffafb

Browse files
Fix Bug if-itb#1
Bug if-itb#1 Empty database password in getHsqldbConnection(String, WebgoatContext) [Scary(7), Normal confidence]
1 parent 2be182f commit 0fffafb

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

webgoat-container/src/main/java/org/owasp/webgoat/session/DatabaseUtilities.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import java.sql.SQLException;
1010
import java.util.HashMap;
1111
import java.util.Map;
12+
import java.util.Properties;
13+
1214
import org.apache.ecs.MultiPartElement;
1315
import org.apache.ecs.html.B;
1416
import org.apache.ecs.html.TD;
@@ -131,7 +133,10 @@ private static Connection getHsqldbConnection(String user, WebgoatContext contex
131133
SQLException
132134
{
133135
String url = context.getDatabaseConnectionString().replaceAll("\\$\\{USER\\}", user);
134-
return DriverManager.getConnection(url, "sa", "");
136+
Properties props = new Properties();
137+
props.setProperty("user","sa");
138+
props.setProperty("password","");
139+
return DriverManager.getConnection(url, props);
135140
}
136141

137142
/**

0 commit comments

Comments
 (0)