How to prevent anti-DNS pinning attacks

How to prevent anti-DNS pinning attacks

How do you prevent anti-DNS pinning in a Web application?

    Requires Free Membership to View

    When you register, you'll receive targeted emails designed to keep you informed of the most relevant information on Agile development, application security, testing & QA, software requirements, and more.

    Hannah Smalltree, Editorial Director

    By submitting your registration information to SearchSoftwareQuality.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchSoftwareQuality.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

Anti-DNS pinning, also known as DNS rebinding, is more of an attack against the end user. To say "my Web application is vulnerable to anti-DNS pinning" would not make sense. The attack takes advantage of deficiencies in the Web browser and fools it into executing JavaScript code that makes hidden Web requests without the user's knowledge.

One defense from the Web application side is to verify that the HTTP host header is correct; however, there are attacks to circumvent this as well, depending on which Web browser the victim is using. Users will likely always be vulnerable to anti-DNS pinning until the browsers (and other client-side components such as Flash) fix the issue.

Software testing resources:
CSRF attack vector with Ajax serialization

How to integrate security into the SDLC (Featured Topic)

How to counter cross-site scripting (XSS) attacks (Featured Topic)

If I'm the owner of a Web application, say Gmail, the best way to protect my users from the effects of anti-DNS pinning attacks is to eliminate cross-site request forgery (CSRF or XSRF) vulnerabilities in my application. While this doesn't prevent anti-DNS pinning itself, it prevents an anti-DNS pinning attack from being able to target users of my particular Web application.

-- Chris Eng, director of security services at Veracode, contributed to this response.

This was first published in December 2007