GPEN · Question #408
How can web server logs be leveraged to perform Cross-Site Scripting (XSSI?
The correct answer is C. If web logs are viewed in a web-based console, log entries containing XSS mayexecute on the. XSS payloads written into web server logs can execute against administrators when those logs are viewed in a browser-based console, making log injection a stored XSS delivery vector.
Question
How can web server logs be leveraged to perform Cross-Site Scripting (XSSI?
Options
- AWeb logs containing XSS may execute shell scripts when opened In a GUI textbrowser
- BXSS attacks cause web logs to become unreadable and therefore are an effective DOS
- CIf web logs are viewed in a web-based console, log entries containing XSS mayexecute on the
- DWhen web logs are viewed in a terminal. XSS can escape to the shell and executecommands.
How the community answered
(39 responses)- A10% (4)
- B3% (1)
- C82% (32)
- D5% (2)
Why each option
XSS payloads written into web server logs can execute against administrators when those logs are viewed in a browser-based console, making log injection a stored XSS delivery vector.
GUI text browsers and standard text editors do not execute JavaScript, so opening log files in such tools displays the XSS payload as inert literal text without triggering script execution.
XSS payloads stored in log entries do not corrupt log formatting or prevent logs from being read; they remain fully legible and do not impair the availability or readability of the logging system.
When an attacker sends HTTP requests containing XSS payloads in fields that get logged - such as User-Agent headers or malformed URL parameters - the web server records the malicious string verbatim in its log files. If an administrator later views those logs through a web-based management interface, the browser parses the log content as HTML and executes the embedded script, potentially allowing the attacker to steal the admin's session cookie or perform privileged actions on their behalf. This technique is sometimes called log poisoning or second-order XSS via log injection.
Terminal-based log viewers render content as plain text without an HTML rendering engine, so XSS payloads cannot be interpreted as executable script or escape to the underlying shell from a command-line context.
Concept tested: Log injection as a stored XSS delivery mechanism
Source: https://owasp.org/www-community/attacks/Log_Injection
Topics
Community Discussion
No community discussion yet for this question.