Home Forums SQL Server 2012 SQL Server 2012 - T-SQL Is there a way to identify dynamic sql that may be vulnerable to sql injection? RE: Is there a way to identify dynamic sql that may be vulnerable to sql injection?

  • juniorDBA13 - Wednesday, January 3, 2018 6:04 AM

    Yes but we support a number of databases and dont have time to check every query so would like someone way to check the databases for vulnerabilities

    A little tough love coming up here... If you don't take the time to check every instance of dynamic SQL for inject-ability, then plan on spending some time explaining how your company suffered a successful attack.  You CAN'T afford to not take the time.  Tell the company to stop making excuses and do it NOW!

    Then implement a rigorous process that prevents unreviewed code from being deployed even to your staging environments.  Again, no excuses... just do it!

    I'll also tell you that you need to do the same thing for your front end code.  At the very least, hire a 3rd party to do penetration testing of your public facing applications and by "public facing", I mean any app outside of IT (we even test the non-public facing stuff).

    This is something you don't want to screw with or let get balled up in stupid politics by managers that don't know any better.  If they think it's expensive to do all of this, wait until they find out the true cost of a successful attack on your systems.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)