Xss & CSRF
Xss & CSRF
Reflected
Stored XSS
XSS
The most damaging type of XSS is The second and the most common
Stored XSS (Persistent XSS). An type of XSS is Reflected XSS - the
attacker uses Stored XSS to inject attacker’s payload has to be a part
malicious content (referred to as the of the request that is sent to the
payload). web server.
DOM-based
XSS
DOM-based XSS is an advanced XSS
attack. It is possible if the web
application’s client-side scripts write
data provided by the user to the
Document Object Model (DOM).
Steps for XSS Attack (Stored XSS) Non-
Persistent
The user comes in contact with a
malicious link, form, or a malicious
redirection. The Web application is
requested prepared the call by the
Bank.
The Web application is requested prepared
the call by the Bank.
The XSS-code is an XSS vulnerability of
the banking application, inserted into
the page.
The infected page with XSS code is sent to
the user.
The XSS-code context of the page arrived at
the user and thus bypassing the "Same
Origin" security setting of the Web browser.
As XSS vulnerabilities continue to grow, the best way to protect yourself from it
is to be careful and be aware of its existence
References
https://learn.snyk.io/lesson/csrf-attack/?loc=learn
https://www.slideshare.net/slideshow/csrf-basics-14161022/14161022#1
https://www.slideshare.net/slideshow/xss-attack/120995223#7
https://www.slideshare.net/slideshow/crosssite-scripting-xss/51281902
https://www.slideshare.net/slideshow/cross-site-scripting-xss/5154250
https://www.slideshare.net/slideshow/cross-site-scripting-47195692/47195692
https://www.slideshare.net/slideshow/understanding-csrf/22270496#6
https://www.acunetix.com/websitesecurity/xss/#:~:text=Types%20of%20XSS%3A
%20Stored%20XSS,attacker%20to%20impersonate%20the%20victim
Thank You!
Anti-CSRF Tokens:
Description:
Include a unique, unpredictable token in requests sent to the server.
How It Works:
The server generates a token and includes it in a form or HTTP request.
When the request is submitted, the token is sent back to the server for
verification.
If the token is missing or invalid, the request is rejected.
Implementation:
Many modern frameworks (e.g., Django, Spring Security) provide
built-in CSRF token mechanisms.
Mitigation Techniques for CSRF Attacks:
SameSite Cookies:
Description:
Use the SameSite attribute for cookies to restrict cross-
origin requests.
How It Works:
SameSite cookies are a security feature that controls whether a
cookie is sent with cross-origin requests. By setting the SameSite
attribute on cookies, web applications can protect themselves
from attacks like CSRF.
SameSite=Lax: Cookies are sent only for top-level navigations and
GET requests.
SameSite=Strict: Cookies are never sent for cross-origin requests.
How It Works:
Prompt users to re-enter their credentials or
provide an OTP before executing critical
actions.
Conclusion •CSRF attacks exploit the trust between users and web
applications, making them a serious threat to data integrity
: and user privacy. By implementing robust security measures,
such as anti-CSRF tokens, SameSite cookies, and secure
Protecting headers, developers can effectively safeguard their
applications.
Against •Key takeaways:
CSRF 1.Always validate user actions with unique tokens.
Attacks 2.Use modern cookie attributes like SameSite to limit cross-
origin risks.
3.Educate users about safe online practices.
•Security is an ongoing process. Regular audits, updates, and
awareness are essential to staying ahead of potential threats.
Protecting against CSRF not only secures your application but
also builds trust with your users.
References
• https://learn.snyk.io/lesson/csrf-attack/?loc=learn
• https://www.slideshare.net/slideshow/csrf-basics-14161022/1416102
2#1
• https://www.slideshare.net/slideshow/understanding-csrf/22270496#
6
• https://people.eecs.berkeley.edu/~daw/teaching/cs261-f11/reading/c
srf.pdf
CLOSING SLIDE
CYBER ATTACK
Thank You For Listening
Done By : Seif & Rakan