Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loading executable code through <img> or <a> tags?

I'm working on an app that would allow people to enter arbitrary URL's that would be included in <a href="ARBITRARY URL"> and <img src="ARBITRARY URL" /> tags.

What type of security risks am I looking at?

The app is coded in PHP, and the only security countermeasure I currently perform is using PHP's htmlentities() function against the input URL before sending it as HTML. I'm also checking to make sure that the URL text starts with either http:// or https:// but I don't know if that's accomplishing anything, security wise.

What else should I be doing to ensure the security of my end users?

like image 806
Dolph Avatar asked Nov 09 '09 21:11

Dolph


People also ask

Does an IMG need to be in an A tag?

The <img> tag is used to insert an image into a document. This element must not contain any content, and does not need a closing tag.

What is the use of IMG tags?

Definition and Usage The <img> tag is used to embed an image in an HTML page. Images are not technically inserted into a web page; images are linked to web pages. The <img> tag creates a holding space for the referenced image.

What is the correct format for an IMG tag?

The <img> tag has 2 required attributes - src and alt. The <img> tag may support (depending on the browser) the following image formats: jpeg, gif, png, apng, svg, bmp, bmp ico, png ico.

Do I need closing tag for IMG?

In HTML, you use the <img> tag to add images to websites. It is an inline and empty element, which means that it doesn't start on a new line and doesn't take a closing tag (unlike the paragraph ( <p> ) tag, for instance).


1 Answers

Take a look at the XSS Checklist.

like image 125
ryeguy Avatar answered Oct 17 '22 01:10

ryeguy