6-Web Application Security
6-Web Application Security
Browser security
e.g. Same Origin Policy – Isolate sites from each other, while running in the same browser
Server app security
Attackers can run arbitrary HTTP clients; can send anything to server
Client app security
Prevent user from being attacked while using web app locally
Protect the user
From social engineering
From trackers, private data being leaked
Why is web security hard?
Injection flaws, such as SQL, NoSQL, OS, and LDAP injection, occur when untrusted
data is sent to an interpreter as part of a command or query.
The attacker’s hostile data can trick the interpreter into executing unintended commands
or accessing data without proper authorization.
2. Broken Authenitcation
Many web applications and APIs do not properly protect sensitive data, such as financial,
healthcare, and PII.
Attackers may steal or modify such weakly protected data to conduct credit card fraud,
identity theft, or other crimes.
Sensitive data may be compromised without extra protection,
such as encryption at rest or in transit,
requires special precautions when exchanged with the browser.
4.XML External Entities (XXE)
Many older or poorly configured XML processors evaluate external entity references
within XML documents.
External entities can be used to disclose internal files using
the file URI handler,
internal file shares,
internal port scanning,
remote code execution, and
denial of service attacks.
5.Broken Access Control
Restrictions on what authenticated users are allowed to do are often not properly
enforced.
Attackers can exploit these flaws to access
unauthorized functionality and/or data,
access other users’ accounts,
view sensitive files,
modify other users’ data,
change access rights, etc.
6.Security Misconfiguration
Components, such as libraries, frameworks, and other software modules, run with the
same privileges as the application.
a vulnerable component can be exploited
such an attack can facilitate serious data loss or server takeover
Applications and APIs using components with known vulnerabilities may
undermine application defenses and
enable various attacks and impacts
10. Insufficient logging and monitoring
SSL connection
a transient, peer-to-peer, communications link
associated with 1 SSL session
SSL session
an association between client & server
created by the Handshake Protocol
define a set of cryptographic parameters
may be shared by multiple SSL connections
SSL Record Protocol Services
confidentiality
using symmetric encryption with a shared secret key defined by Handshake Protocol
AES, IDEA, RC2-40, DES-40, DES, 3DES, Fortezza, RC4-40, RC4-128
message is compressed before encryption
message integrity
using a MAC with shared secret key
similar to HMAC but with different padding
SSL Record Protocol Operation
SSL Change Cipher Spec Protocol
one of 3 SSL specific protocols which use the SSL Record protocol
a single message
causes pending state to become current
hence updating the cipher suite in use
SSL Alert Protocol
specific alert
fatal: unexpected message, bad record mac, decompression failure, handshake failure, illegal
parameter
warning: close notify, no certificate, bad certificate, unsupported certificate, certificate revoked,
certificate expired, certificate unknown
connection initiation
TLS handshake then HTTP request(s)
connection closure
have “Connection: close” in HTTP record
TLS level exchange close_notify alerts
can then close TCP connection
must handle TCP close before alert exchange sent or completed
Secure Shell (SSH)