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 8999635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:12:22+00:00 2026-06-16T00:12:22+00:00

This question is about security threat. I wonder at the below usage can DropDownList

  • 0

This question is about security threat. I wonder at the below usage can DropDownList selected value changed at client side and affect the server side ?

Here the usage (aspx definition)

  <asp:DropDownList AutoPostBack="true" ID="dropDownListDrawingArtists" CssClass="DropDownArtists"
                runat="server">
  </asp:DropDownList>

server side filling

    if (IsPostBack == false)
    {
        if (srLang == "tr")
        {
            dropDownListDrawingArtists.Items.Add("Çizen Artist Filtresi: Bütün Çizen Artistler");
        }
        else
        {
            dropDownListDrawingArtists.Items.Add("Drawing Artist Filter: All Drawing Artists");
        }

        DataSet dsDrawingArtists = DbConnection.db_Select_Query("select DrawingArtist,COUNT(PokemonId) as Pokecount from tblPokedex group by DrawingArtist order by Pokecount desc,DrawingArtist asc");

        for (int i = 0; i < dsDrawingArtists.Tables[0].Rows.Count; i++)
        {
            dropDownListDrawingArtists.Items.Add(dsDrawingArtists.Tables[0].Rows[i]["DrawingArtist"].ToString());
        }

        if (Session["FilterByArtist"] != null)
        {
            dropDownListDrawingArtists.SelectedIndex = Convert.ToInt32(Session["FilterByArtist"].ToString());
        }
    }

And the final usage at postback

    if (dropDownListDrawingArtists.SelectedIndex > 0)
    {
        srFilterByDrawingArtist = " and DrawingArtist='" + dropDownListDrawingArtists.SelectedItem.ToString() + "'";
        Session["FilterByArtist"] = dropDownListDrawingArtists.SelectedIndex.ToString();
    }

As you can see i am directly using it at the SQL query. I tested myself at google chrome. Changed the values of dropDownListDrawingArtists and done a postback. the value at the server side was not effected. Just to be sure

thanks for answers

asp.net 4.0 C# 4.0

  • 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-06-16T00:12:23+00:00Added an answer on June 16, 2026 at 12:12 am

    Whether it is currently possible or not is irrelevant. You should still be using parameterized queries instead of contencating the stgrings.

    The reasoning for this is the same as the reasoning that OWASP defines character escaping as “weak” compared to parameterized queries and parameterized stored procedures, and why white listing is better than blacklisting.

    From the OWASP cheat sheet to Preventing SQL Injection:

    This third technique is to escape user input before putting it in a
    query. If you are concerned that rewriting your dynamic queries as
    prepared statements or stored procedures might break your application
    or adversely affect performance, then this might be the best approach
    for you. However, this methodology is frail compared to using
    parameterized queries
    (emphasis mine) and we cannot guarantee it will prevent all SQL
    Injection in all situations. This technique should only be used, with
    caution, to retrofit legacy code in a cost effective way. Applications
    built from scratch, or applications requiring low risk tolerance
    should be built or re-written using parameterized queries.

    The reason it’s frail is that someone is always working on a new way to exploit any potential hole. What works to prevent tampering today may be circumvented tomorrow.


    That said, currently, the ViewState protection offers protection for this. If someone tampers with the list, they will generally get an automatically generated “Invalid Viewstate” error, and the code wont’ process.

    http://msdn.microsoft.com/en-us/magazine/ff797918.aspx

    But don’t rely on that behavior. It can be turned off, and I’ve seen a Jr. Developer turn it off to try to resolve errors. (Thank goodness for code reviews.)

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

Sidebar

Related Questions

I asked a question about different testing frameworks yesterday. This question can be found
Not sure where to post this question, but I am concerned about the security
This question is about trying to understand the security risks involved in implementing oauth
Update : I have changed this question to be about the specific problem I
Before going live with my website, i made some thoughts about security: This question
This question is specifically about how to correctly implement session security in a function/OOP/MVC
This question about Timers for windows services got me thinking: Say I have (and
Followed this question about delayed_job and monit Its working on my development machine. But
Note: I originally asked this question about an hour ago but only recently realized
I've this question about pass some instances by ref or not: here is my

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.