Skip to content

Commit 3079397

Browse files
Changed the field1.replaceAll to field1 = field1.replaceAll. The first case does not clean the taint
git-svn-id: http://webgoat.googlecode.com/svn/trunk@474 4033779f-a91e-0410-96ef-6bf7bf53c507
1 parent dec4f45 commit 3079397

File tree

1 file changed

+5
-4
lines changed
  • webgoat/src/main/webapp/lessons/Ajax

1 file changed

+5
-4
lines changed

webgoat/src/main/webapp/lessons/Ajax/eval.jsp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ if(field1 == null) field1 = "123";
1212
if(field2 == null) field2 = "-1";
1313
1414
/** For security reasons, we remove all '<' and '>' characters to prevent XSS **/
15-
field1.replaceAll("<", "");
16-
field1.replaceAll(">", "");
17-
field2.replaceAll("<", "");
18-
field2.replaceAll(">", "");
15+
// Thank you Victor Bucutea for noticing replaceAll only cleans taint to the return value.
16+
field1 = field1.replaceAll("<", "");
17+
field1 = field1.replaceAll(">", "");
18+
field2 = field2.replaceAll("<", "");
19+
field2 = field2.replaceAll(">", "");
1920
2021
if("Purchase".equals(action))
2122
{

0 commit comments

Comments
 (0)