0

I get this recommendation form Security review module:

It is recommended you remove the following tags from roles accessible by untrusted users: img

I am wondering what real world threats can img pose?

1

Project page of security review module says

Text formats don't allow dangerous tags (protecting against XSS)

Cross-Site Scripting (XSS) attacks are a type of injection, in which malicious scripts are injected into otherwise benign and trusted web sites. XSS attacks occur when an attacker uses a web application to send malicious code, generally in the form of a browser side script, to a different end user. Flaws that allow these attacks to succeed are quite widespread and occur anywhere a web application uses input from a user within the output it generates without validating or encoding it.

An attacker can use XSS to send a malicious script to an unsuspecting user. The end user’s browser has no way to know that the script should not be trusted, and will execute the script. Because it thinks the script came from a trusted source, the malicious script can access any cookies, session tokens, or other sensitive information retained by the browser and used with that site. These scripts can even rewrite the content of the HTML page.

For example you can use img tag as below for XSS attack..

<img src='#' onerror=alert(1) />
  • Thanks Anil for the info. So how can we allow users of a social site (which obviously are not all trusted) to upload images while avoiding this threat? – alfish May 22 '14 at 6:12
  • @alfish, this is not a forum, so please don't use the comment field to ask a new question. Instead, press the "Ask question" button and ask a new question. What you ask in the comment above is a good question, but I am not going to answer it before it is asked as a new question. (Refer back to this question to provide context.) – Free Radical May 22 '14 at 6:43
  • Here it is:drupal.stackexchange.com/questions/114903/… – alfish May 22 '14 at 6:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.