CompTIA Security+ SY0-701 · Threats, Vulnerabilities, and Mitigations · medium

A web application allows authenticated users to fetch profile avatars by passing a URL parameter avatarUrl=https://cdn.example.com/pic.png. An attacker passes avatarUrl=http://169.254.169.254/latest/meta-data/iam/ and retrieves the cloud instance's IAM credentials. What vulnerability was exploited?

Published · Last updated · checked before publication — how we verify questions

Options

  • ACross-Site Request Forgery (CSRF) riding on a victim's browser session cookie
  • BServer-Side Request Forgery (SSRF) querying the internal metadata endpointCorrect answer
  • CReflected Cross-Site Scripting (XSS) executing JavaScript in the DOM
  • DXML External Entity (XXE) expansion via a SOAP document DTD header

Answer: B. Server-Side Request Forgery (SSRF) querying the internal metadata endpoint

Server-Side Request Forgery (SSRF) occurs when an application fetches a remote resource based on an unvalidated user-supplied URL, allowing an attacker to coerce the server into making requests to internal-only addresses such as the cloud instance metadata service (169.254.169.254).

Why the other options are wrong

  • A. Cross-Site Request Forgery (CSRF) riding on a victim's browser session cookie — CSRF tricks a victim's browser into sending a request; here the server itself fetches an internal URL.
  • C. Reflected Cross-Site Scripting (XSS) executing JavaScript in the DOM — XSS executes client-side script in a user's browser rather than making server-side HTTP requests.
  • D. XML External Entity (XXE) expansion via a SOAP document DTD header — The exploit used an unvalidated URL fetch parameter (avatarUrl), which is classic SSRF.

All Threats, Vulnerabilities, and Mitigations questions and the topic overview →

CompTIA and Security+ are trademarks of the Computing Technology Industry Association. PrepIQ Hub is not affiliated with, endorsed by, or sponsored by CompTIA.