Ask the Expert

To prevent cross-site scripting, should specific words and characters be rejected?

I'm interested in preventing cross-site scripting (XSS) attacks. If we reject characters and words like <, >, script, -- and their equivalent entity values, etc., that can cause malicious attacks -- it increases the cost of application development. Would you recommend this course of action?

    Requires Free Membership to View

No. Instead, I recommend that developers code their applications to only allow the required set of characters necessary for the application to function properly. That is an application development best practice.

Many organizations view secure coding as an activity that is supposed to happen at the end of the development process. However, if someone testing an application at the end of the development lifecycle says an application needs recoding to ensure its security, that application will need to be reworked and retested, along with any other application that interacts with it. This constant tweaking is often far more expensive than implementing an iterative security process throughout an application development lifecycle.

If there is a field called "State," for example, there is no reason to allow <, > ;, *, --, or : as possible values. If application developers write code from the perspective of only accepting known good values, it decreases the overall cost of application development by cutting quality assurance and certification and accreditation testing.

For more help, a great framework to use is the Scalable & Agile Lifecycle Security for Applications.

More information:

  • Video: Security researchers at Information Security Decisions 2008 recently discussed how to keep enterprises safe from cross-site scripting and buffer overflows.
  • This was first published in January 2009

    There are Comments. Add yours.

     
    TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

    REGISTER or login:

    Forgot Password?
    By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
    Sort by: OldestNewest

    Forgot Password?

    No problem! Submit your e-mail address below. We'll send you an email containing your password.

    Your password has been sent to: