Threats and Attacks

What Is XSS (Cross-Site Scripting)?

Cross-Site Scripting, or XSS, is a security flaw in websites that lets attackers add harmful scripts to web pages. Most of the time, these scripts are written in JavaScript.

What Is XSS (Cross-Site Scripting)?

Cross-Site Scripting, or XSS, is a security flaw in websites that lets attackers add harmful scripts to web pages. Most of the time, these scripts are written in JavaScript.

If someone visits a page affected by XSS, their browser runs the attacker’s script. This can result in stolen cookies, hijacked sessions, or actions taken without the user’s permission.

XSS, like SQL Injection, is regularly listed in the OWASP Top 10 as one of the most common web application vulnerabilities.

plexicus-xss-attack-ilustration

How XSS Works ?

XSS often targets web applications that do not correctly check and clean user input.

For example, if a comment box allows raw HTML or JavaScript without any filtering, an attacker could add code like this:

<script>alert('Hacked!');</script>

When victims view the page, the malicious code runs inside their browser.

Why XSS Matters in Cybersecurity

XSS can lead to a bigger breach :

  • Account takeover (stealing session cookies to impersonate users)
  • Data theft (capturing form inputs like passwords or credit cards)
  • Phishing attacks (injecting fake login forms)
  • Malware delivery (redirecting users to malicious websites)

Types of XSS

  1. DOM-Based XSS
  2. The attack happens entirely in the browser by manipulating the Document Object Model (DOM) without involving the server.
  3. Stored XSS
  4. Malicious script is permanently stored on the server, such as the database, profile page.
  5. Reflected XSS
  6. Script is reflected off a web server (e.g, in URL or error message), the script will be executed when the victim clicks crafted link by attackers.

How to Prevent XSS

  • Input sanitization & output encoding : always cleaning user input data before processing it, transforming user input into a safe format
  • Use Content Security Policy (CSP) : restricts what script can be executed in the browser.
  • Avoid eval() and inline JavaScript : to reduce injection risks.
  • Security testing (DAST/IAST) : run security testing to detect vulnerabilities early

Example in Real World Case - Samy worm (MySpace, 2005)

What happened: Samy Kamkar published a MySpace profile that contained a stored XSS payload. When other users viewed the profile, the payload ran in their browsers, it (a) added Samy as a friend, (b) appended the phrase “Samy is my hero” to their profiles, and (c) replicated itself to those users’ profile pages.

Impact: The worm self-propagated to ~1 million users within ~20 hours, forcing MySpace offline temporarily.

Why it worked: MySpace allowed unescaped HTML/attributes in profile fields, enabling stored script execution in visitors’ browsers.

Lessons / fix: Proper output encoding, input sanitization, removal of HTML in profile fields, and rapid patching. Samy later faced legal consequences, and MySpace deployed filters.

Ready to validate what matters?

Ready to validate what matters?

Plexicus is Proof-Driven AppSec: validated findings, contextual understanding, and reviewed remediation — anchored in evidence, scoped with you.

Qualification

Check whether AI Swarm Pentest fits your environment.

Share the minimum context. We will review the scope and tell you the next commercial step.

Before submitting — verify you fit

Teams with fewer than 50 developers: start a 14-day Trial instead of booking a demo. Start a 14-day Trial →

0 / 280

No commitment. If you don't fit, we'll tell you.

SAMPLE HANDOVER · ILLUSTRATIVE

Sample evidence handover

A trimmed view of what your team receives at the end of an AI Swarm Pentest engagement. Real engagements include full technical evidence, executive narrative, and a remediation plan.

VALIDATED FINDING Evidence attached

Server-Side Request Forgery in webhooks/receiver

demo-project/sample-app · src/webhooks/receiver.py:42

SeverityHigh CVSS 3.18.6 Priority79 Confirmedvia replay

Untrusted caller-supplied URLs reach an internal egress without an allowlist. Replayed in a sandbox against a fresh authorised target — the same control was validated to fail twice.

REVIEWER-READY REMEDIATION Merge-ready PR

Validate the target URL against an allowlist of permitted hostnames. Reject private/internal IP ranges. Enforce HTTPS only.

plexicus/remediation/webhooks-ssrf 3 changed · 0 new files
42resp = requests.get(target_url)
42+if not is_allowed_host(target_url):
43+  raise WebhookRejected(target_url)
44+resp = requests.get(target_url, timeout=5)
Every engagement hands over:
  • Executive briefing
  • Validated findings list
  • Merge-ready PRs
  • Compliance mapping (NIS2 · DORA · CRA)