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

  • Home
  • SEARCH
  • 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 33073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T13:51:47+00:00 2026-05-10T13:51:47+00:00

User equals untrustworthy. Never trust untrustworthy user’s input. I get that. However, I am

  • 0

User equals untrustworthy. Never trust untrustworthy user’s input. I get that. However, I am wondering when the best time to sanitize input is. For example, do you blindly store user input and then sanitize it whenever it is accessed/used, or do you sanitize the input immediately and then store this ‘cleaned’ version? Maybe there are also some other approaches I haven’t though of in addition to these. I am leaning more towards the first method, because any data that came from user input must still be approached cautiously, where the ‘cleaned’ data might still unknowingly or accidentally be dangerous. Either way, what method do people think is best, and for what reasons?

  • 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. 2026-05-10T13:51:48+00:00Added an answer on May 10, 2026 at 1:51 pm

    I like to sanitize it as early as possible, which means the sanitizing happens when the user tries to enter in invalid data. If there’s a TextBox for their age, and they type in anything other that a number, I don’t let the keypress for the letter go through.

    Then, whatever is reading the data (often a server) I do a sanity check when I read in the data, just to make sure that nothing slips in due to a more determined user (such as hand-editing files, or even modifying packets!)

    Edit: Overall, sanitize early and sanitize any time you’ve lost sight of the data for even a second (e.g. File Save -> File Open)

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

Sidebar

Related Questions

User Story: Action for Facebook that has open graph object. For this I need
User inserts a string in a html form input on browser. This string is
User profile. I have some attributes that have only 2 or 3 options. For
User Defined Function (UDFs) are functions that one can program and can be dynamically
I have a simple example to check login of user using MVC Model.. LoginModel:
I'm creating a linq query to get some data that will return a list
I have the following form: <form:form method=POST action=signin.dlp commandName=user > <form:input path=useremail id=useremail /><FONT
I've two backing beans: Login : a bean that validates the user login info
I wonder what is the best way to test a method that only checks
User has many Tracks, through Favorite. Favorite has some extra per-user meta-data about the

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.