Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7653717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:05:42+00:00 2026-05-31T12:05:42+00:00

In asp.net is the PagesSection.ValidateRequest method enough to prevent all XSS attacks or is

  • 0

In asp.net is the PagesSection.ValidateRequest method enough to prevent all XSS attacks or is there something more that needs to be done?

Can anyone point me to a more thorough resource on this topic specifically for asp.net as Google mainly returns MSDN articles and I’d like to verify that we’re doing enough.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T12:05:44+00:00Added an answer on May 31, 2026 at 12:05 pm

    AntiXSS Library

    The Microsoft AntiXSS library is a good solution for ASP.Net. It uses a whitelist (versus blacklist) approach and seems to be regularly updated by Microsoft.

    Latest download (as of this post): http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=28589

    AntiXSS supports both text and HTML-style validation. The HTML validation does permit content that might be undesirable (such as images in another domain).

    It requires that you run each of your input values through the library which will result in additional (albeit simple) code.

    using System;
    using Microsoft.Security.Application;
    
    public class AppText
    {
        public static string GetSafeHtml( string inputText )
        {
            return Sanitizer.GetSafeHtmlFragment( inputText );
        }
    
        public static string GetSafeText( string inputText )
        {
            return Microsoft.Security.Application.Encoder.HtmlEncode( inputText );
        }
    }
    

    Benefits

    Manually validating each input ensures that you are not assuming security is just “handled” by ASP.Net request validation. It also gives you the flexibility to disable request validation if needed (there are legitimate cases for questionable characters in a request). Because you are validating the input explicitly with the AntiXSS library, you can allow characters/markup in the request.

    General XSS Info

    https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

ASP.NET newbie question - fastest fingers! I have a page that needs to pull
ASP.Net MVC3 is cool and all but I have this question more out of
ASP.NET 2.0 provides the ClientScript.RegisterClientScriptBlock() method for registering JavaScript in an ASP.NET Page. The
ASP.NET 1.1 - I have a DataGrid on an ASPX page that is databound
[ASP .Net - Microsoft Visual Web Developer 2010] Hi all, I've problem with this
Asp.net team had designed script manager such that only one instance existed per page(HttpHandler),
ASP.NET MVC has a handy HtmlHelper extension called ValidationSummary, for when something goes wrong.
ASP.NET For each appSetting I use, I want to specify a value that will
ASP.NET has a feature that allows you to declare implicitly used namespaces in the
ASP.NET MVC app, close to completion, then it was decided that it needed a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.