Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

An attacker can enter a specially crafted argument in an attempt to inject malicious JavaScript. Here is an example malicious string; it contains JavaScript code that can create or overwrite an existing file on a Windows system running the vulnerable Java code.

Code Block
bgColorffffcc
languagejavascript
dummy\');
var bw = new JavaImporter(java.io.BufferedWriter); 
var fw = new JavaImporter(java.io.FileWriter); 
with(fw) with(bw) { 
   bwr = new BufferedWriter(new FileWriter(\"c://somepath//somefile.txt\"));
   bwr.write("some text"); bwr.close();
}
// ; 

...