SShortSingh.
Back to feed

Understanding Cross-Site Scripting: Reflected, Stored, and DOM-Based XSS Explained

0
·1 views

Cross-site scripting (XSS) is a web security vulnerability that allows attackers to inject malicious scripts into web pages viewed by other users. Reflected XSS occurs when user-supplied input from an HTTP request is immediately returned in the server's response without proper sanitization. Stored XSS, also called persistent XSS, happens when malicious data submitted by an attacker is saved and later served to other users, such as through blog comments. DOM-based XSS arises when client-side JavaScript processes attacker-controlled input, like URL parameters, and passes it to dangerous execution sinks such as eval() or innerHTML. Defenses like Content Security Policy (CSP) can reduce XSS impact, though they can sometimes be circumvented, making proper input validation and output encoding essential.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Why Static Config Checks Are Not Enough to Secure AI Agents With Tool Access

As LLM-based agents gain the ability to execute tools — such as shell commands, HTTP fetchers, and cloud SDKs — the risk shifts from harmful text output to harmful real-world actions performed with user credentials. Security researchers highlight four key abuse patterns: remote code execution via shell tools, server-side request forgery through HTTP fetchers, credential exfiltration via environment variables, and unauthorized tool calls triggered by prompt injection. Static configuration scanners, such as the open-source correctover-scan tool, can catch setup-level issues like plain-HTTP transports, hardcoded credentials, and overly broad permissions across common MCP config files. However, experts warn that static analysis cannot evaluate the specific arguments an agent constructs and passes to tools at runtime, which is where many real threats materialize. Runtime verification is therefore presented as a necessary complement to configuration hygiene for teams deploying agents with tool access.

0
ProgrammingDEV Community ·

Developer's Custom AppSec LLM Prompt Found 4 Real Gaps After Filtering AI Noise

A developer nearly filed 23 unverified vulnerability reports against open-source projects after running a self-built AppSec prompt across several repositories, with the LLM flagging XSS, CORS, CSP, and suspicious SVG issues in bulk. The author paused to question whether the volume of findings would be taken seriously by maintainers, which prompted a rethink of how the prompt was structured. The key shift was writing a strict contract before any code review — defining what the model was permitted to assert, anchored to OWASP ASVS 5.0 requirement IDs rather than vague best practices. Discipline rules were added to separate findings from observations and hypotheses, and to prevent the model from mixing discovery with fixes in the same session. The author concludes that static scanners like Semgrep and CodeQL remain essential for pattern-based detection, while LLM-driven hunting adds value only for semantic gaps — absent controls that no regex can identify.

0
ProgrammingDEV Community ·

How to Build GDPR-Compliant Consent Revocation Gates in Go Runtime Systems

A software engineer has outlined a technical approach to handling GDPR consent withdrawal in developer tools, warning that simply deleting a database row or toggling a UI flag does not immediately cut off data access. The core recommendation is to model consent withdrawal as an auditable state transition, ensuring every runtime authorization check reads the current consent status before touching personal data. The proposed system uses two API endpoints — one to record withdrawal and one to check per-category consent — with a Go-based authorization function that blocks processing as soon as consent is revoked. The engineer also highlights race conditions where a data operation in flight can complete after a revoke transaction commits, and argues that idempotent deletion workers and conditional database writes are necessary to prevent duplicate or post-withdrawal processing. A trade-off between strongly consistent checks and cached consent state is acknowledged, with the recommendation to favor consistency for personal data despite the added latency cost.

Understanding Cross-Site Scripting: Reflected, Stored, and DOM-Based XSS Explained · ShortSingh