Stories
Slash Boxes
Comments

SoylentNews is people

posted by chromas on Saturday June 15 2019, @04:11PM   Printer-friendly
from the ';
dropâ €trou;#
dept.

SQL Injection Attacks Represent Two-Third of All Web App Attacks

For its "State of the Internet" report, Akamai analyzed data gathered from users of its Web application firewall technology between November 2017 and March 2019. The exercise shows that SQL injection (SQLi) now represents nearly two-thirds (65.1%) of all Web application attacks. That's up sharply from the 44% of Web application layer attacks that SQLi represented just two years ago.

Local File Inclusion (LFI) attacks, which, like SQLi, are also enabled by a Web application's failure to properly validate user input, accounted for another 24.7% of attacks. Together, SQLi and LFI attacks represented 89.8% of all attacks at the Web application layer over the 17-month period of Akamai's study.

[...] SQL injection errors and cross-site scripting (XSS) errors have topped, or nearly topped, the Open Web Application Security Project's (OWASP) list of top 10 Web vulnerabilities for more than a decade. Just this week, in fact, HackerOne published a report showing XSS errors to be by far the most common security vulnerability in Web apps across organizations. Both XSS and SQLi are well understood, and many researchers have catalogued the dangers associated with them for years.

The fact that so many Web apps still have them reflects the relatively scant attention paid to security in the application development stage, says Andy Ellis, chief security officer at Akamai. "It is not that the developers are making errors," he says. "It is system that we put them into that is dangerous."

[...] Akamai's data[pdf] shows most Web application attacks originate from inside the US and most targets are US-based as well. Of the nearly 4 billion application-layer attacks that Akamai counted over the 17-month period, some 2.7 billion targeted US organizations. Companies in the UK, Germany, Brazil, and India were also relatively heavily targeted. though nowhere nearly as much as US companies.


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 2) by stormreaver on Sunday June 16 2019, @01:15AM (4 children)

    by stormreaver (5101) on Sunday June 16 2019, @01:15AM (#856114)

    Escape everything. Even the output fields from a DB.

    If you find yourself escaping/unescaping, you've already lost. Use prepared statements and solve the problem. Everything else is sabotaging yourself, your coworkers, and your customers.

    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2  
  • (Score: 0) by Anonymous Coward on Sunday June 16 2019, @03:23AM

    by Anonymous Coward on Sunday June 16 2019, @03:23AM (#856145)

    That only fixes it at the SQL level. I can turn my outputs into HTML/JS/whatever then use that code to jump back in somewhere else into the megabytes of other functions you have conveniently linked in for me. May take me a couple of jumps but I can find the hole. Never trust your inputs even if from a secure source. Make sure they stay the type you expect at your output level. Otherwise I can jump your implicit sandbox, and rather easily. I can also abuse your stored procs to do my bidding. with_reocmpile is my buddy too :)

  • (Score: 2, Funny) by Ethanol-fueled on Sunday June 16 2019, @05:21AM

    by Ethanol-fueled (2792) on Sunday June 16 2019, @05:21AM (#856167) Homepage

    Real N.I.G.G.A.Z. use LabVIEW [jkitchtech.com] for SQL sheeit. Not only is it much more safe, but more easy to read.

  • (Score: 2) by edIII on Thursday June 20 2019, @10:22PM (1 child)

    by edIII (791) on Thursday June 20 2019, @10:22PM (#858267)

    Don't be so sure :)

    How does the prepared statement with parameterized queries work again? Look into the code and you will find they run a standard escape function against it. The only difference between escaping it yourself, and the function, is that the function will produce the same output all the time.

    If your data abstraction layer is playing those same escape games, then you've just received a heapin' helping of false confidence. Escaping things properly is a bitch. Why try when you can regex the single quotes and semi-colons out of the string entirely. Only a few use cases require dealing with that, and if it doesn't require searchability, then BASE64 encoding annihilates SQLi. If searchability is important, you can still remove those characters from the search input as well as the DB, or convert them to HTML entity codes. Super paranoid, you could create a field that stored positional data on where to put them back, and use that in an export functions.

    The single quote and semi-colon are your enemies, and you should only trust your own regex code that you can see yourself. The vast majority of all use cases survive their complete removal.

    --
    Technically, lunchtime is at any moment. It's just a wave function.
    • (Score: 2) by stormreaver on Friday June 21 2019, @12:41AM

      by stormreaver (5101) on Friday June 21 2019, @12:41AM (#858336)

      Any database that implements parameterized queries using escapes and unescapes is fundamentally broken. PostgreSQL, for example, bypasses the parser entirely for prepared statement parameters (as it should). I could easily see MySQL escaping and unescaping, though. But that's because MySQL is fundamentally broken on a number of levels.