Does anyone know of a good lib where I can run lines before inserting them, which could strip sql / javascript code? To run in jsp pages.
The idealism of lib would be:
Thanks in advance to the SO community, who will happily respond :)
Apache Commons lang StringEscapeUtils will bring you part of the path. He slips away, does not separate.
http://commons.apache.org/lang/api/org/apache/commons/lang/StringEscapeUtils.html
: Escaping , , , , , .
api . sql , , . .
: , , , . sql . .
javascript, , . , , , SO, . , .
AntiSamy OWASP. , , . Java, , .
, , , "" . , , , .
, , :) api - :)
c: out XML. , - , , , .
SQL, PreparedStatement. - , , PreparedStatement. HTML JavaScript, . XML. JSTL escapeXml, fn tld.
, :
OP SQL JavaScript.
SQL Injection , , / . Java PMD ( PMD) Findbugs ( Findbugs ) SQL-. OWASP SQL- Java.
As for the script injection, the safest way to prevent hacked scripts from running is to ensure that user input, when used as output, should be displayed using a coded format - for web applications, this will be HTML encoding . This OWASP page shows you how to perform HTML encoding in Java.
Source: https://habr.com/ru/post/1774522/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1774517/tortoisesvn-approaches-to-resolve-tree-conflicts&usg=ALkJrhj0tFIt_JehX3BA2Ya4i_iyj4eHCAoperator + = overload, why const? - c ++Can I set the "isa" attribute of a Moose object attribute when building? - perlOverloading << and >> in inherited classes - c ++How to protect against SQL injection when a WHERE clause is dynamically created from a search form? - javahttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1774523/create-report-with-pageviews-and-unique-visitors-using-gapi&usg=ALkJrhhWWC3XfbzCpIWlPuIngvjJ84Xh4gHow to manage a key in a symmetric algorithm - c #How to get pseudocode Radon Transform from equation - mathMVC 2 EditorForModel defines the width of the generated input - asp.net-mvc-2SQL Injection in Java and MySQL when using multiple queries - javaAll Articles