Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How do I prevent a db injection attempt application break

How do I prevent a db injection attempt application break

Scheduled Pinned Locked Moved ASP.NET
questiondatabasecsharptoolshelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lara Nabozny
    wrote on last edited by
    #1

    Hi there, I need to prevent possible db injection attacks, I have proper validation strings in the form to replace potentially harmful characters, however there seams to be something built into .NET that screams when it sees the angle bracket followed by the word "script" before it performs any validation or string replacement function. I know hackers use these errors to thier advantage, so how can I keep the site from breaking at all if someone attempts to use this tactic to inject my database? The only solution I can think of is to use a custom generic error page - that of course reveals no info - but the fact that an error occured does. Any suggestions? - Thanks!

    O V 2 Replies Last reply
    0
    • L Lara Nabozny

      Hi there, I need to prevent possible db injection attacks, I have proper validation strings in the form to replace potentially harmful characters, however there seams to be something built into .NET that screams when it sees the angle bracket followed by the word "script" before it performs any validation or string replacement function. I know hackers use these errors to thier advantage, so how can I keep the site from breaking at all if someone attempts to use this tactic to inject my database? The only solution I can think of is to use a custom generic error page - that of course reveals no info - but the fact that an error occured does. Any suggestions? - Thanks!

      O Offline
      O Offline
      Olivier_Giulieri
      wrote on last edited by
      #2

      You may want to add a validateRequest="false" in the page directive to disable the validation, and use SQL parameters to prevent potential SQL injection. Also, read about cross site scripting (XSS) while at it b/c your may be vulnerable to it too.

      1 Reply Last reply
      0
      • L Lara Nabozny

        Hi there, I need to prevent possible db injection attacks, I have proper validation strings in the form to replace potentially harmful characters, however there seams to be something built into .NET that screams when it sees the angle bracket followed by the word "script" before it performs any validation or string replacement function. I know hackers use these errors to thier advantage, so how can I keep the site from breaking at all if someone attempts to use this tactic to inject my database? The only solution I can think of is to use a custom generic error page - that of course reveals no info - but the fact that an error occured does. Any suggestions? - Thanks!

        V Offline
        V Offline
        Vimalsoft Pty Ltd
        wrote on last edited by
        #3

        User Parameterized queries and stop assuming that the user is feeding your application the correct data. Look at this Introduction to SQL Injection [^] Hope it Helps

        Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups