Answer the question
In order to leave comments, you need to log in
Is this xss (or other) considered a vulnerability?
Hello.
There is a div where, for example, the username is displayed.
There is an input in which we can change the username and this div should change on the page.
such an ajax request
<div class="user_name">Ivan</div>
<input type="text" class="user-name-input">
$(document).on('click', '.change-user-name', function(){
var user_name = $('.user-name-input').val();
$.ajax({
url: '/core/action/path/file.php',
type: 'POST',
data: {
user_name: user_name
},
dataType: 'json',
success: (data)=> {
$('.user_name').html(user_name );
}
});
});
<script>alert('h');</script>
Answer the question
In order to leave comments, you need to log in
Try this:
In theory, this will not lead to the execution of the script.
$('.user_name')[0].innerHTML = user_name;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question