0

how to fix this vulnerability?

<input type=hidden name=target value="$$target$$">
Injection Code

Injection
<input type=hidden name=target value="https://test/ff5b27051cb9fatest" accesskey=x onclick=alert(document.location)"">
James Z
  • 12,209
  • 10
  • 24
  • 44
Dinesh
  • 15
  • 4

1 Answers1

0

You are not encoding " characters. This allows the attacker to terminate your HTML attribute (value) and inject their own (onclick). As others have mentioned, you should use a trusted sanitizer, but the key vulnerability as you have shown is the failure to encode quotes.

ebuntu
  • 151
  • 1
  • 8