Skip to content

Instantly share code, notes, and snippets.

@ethicalhack3r
Created August 21, 2013 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ethicalhack3r/6296321 to your computer and use it in GitHub Desktop.
Save ethicalhack3r/6296321 to your computer and use it in GitHub Desktop.
DOM XSS - Exploitable without user entering/pasting payload?
<html>
<head>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script>
$(function(){
$( "#button" ).click(function() {
var query = $("form#DevSearch").find('input[type=text]').val();
$("span#searchQuery").html(query);
});
});
</script>
</head>
<body>
<form id="DevSearch" method="post">
<input type="text" name="search" />
<input type="submit" id="button" value="Search" href="#" />
</form>
<span id="searchQuery"></span>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment