Zhumengxin / webgoat

Automatically exported from code.google.com/p/webgoat
0 stars 0 forks source link

Javascript Error in Class DOMInjection #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Javascript wants to access the textfield named "key" via an ID which is 
not given. So the XMLHTTREQUEST always fails.

In DOMInjection.java:

function validate() {
var keyField = document.getElementById('key');
...

------------------
Fix it to:
function validate() {
var keyField = document.getElementsByName('key')[0];
...

or give the textfield "key" the appropriate ID and keep on using "var 
keyField = document.getElementById('key')";

To fix the problem temporarily while using the lesson, give a new 
attribute to the text field named "id" with value "key" using firebug.

Original issue reported on code.google.com by thefunkw...@gmail.com on 13 Dec 2007 at 1:05

GoogleCodeExporter commented 9 years ago
Ahm..Same for the other AJAX Skripts.

Original comment by thefunkw...@gmail.com on 13 Dec 2007 at 1:10

GoogleCodeExporter commented 9 years ago
Will fix in next release

Original comment by mayhe...@gmail.com on 1 Feb 2008 at 1:35

GoogleCodeExporter commented 9 years ago

Original comment by mayhe...@gmail.com on 10 Jul 2008 at 6:32

GoogleCodeExporter commented 9 years ago
Actually, I think the problem was happening because the lesson was returning 
the 
lesson HTML again incase of incorrect key to eval was throwing an error trying 
to 
evaluate a whole bunch of HTML. Fixed this by catching the exception and 
showing an 
appropriate message.

Original comment by sherif.fathy on 12 Jul 2008 at 5:56

GoogleCodeExporter commented 9 years ago

Original comment by sherif.fathy on 12 Jul 2008 at 5:57