CEH Practice Question: Advanced Topics: Wireless, Cloud, IoT, Cryptography
During a cloud penetration test, a tester discovers an AWS S3 bucket that allows public 's3:PutObject' access. The tester uploads a file containing JavaScript that steals cookies. Which type of attack is this an example of?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Cross-Site Scripting (XSS) via uploaded file
Uploading malicious content to an S3 bucket with public write access enables storage of attacker-controlled files. When users access these files, a client-side attack (like XSS) can occur. This is a classic example of a storage-based attack via misconfigured S3 bucket.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Cross-Site Scripting (XSS) via uploaded file
Why this is correct
Cross-Site Scripting (XSS) via uploaded file occurs when an attacker uploads malicious client-side script, typically JavaScript, to a web-accessible resource like a public AWS S3 bucket. If the bucket is configured to serve the file with an executable Content-Type (e.g., text/html or application/javascript) and a user's browser accesses this file directly, the script executes within the user's browser context. This allows the attacker to steal session cookies, deface the page, or redirect users, leveraging the trust in the S3 domain.
- ✗
Server-Side Request Forgery (SSRF)
Why it's wrong here
Server-Side Request Forgery (SSRF) involves an attacker tricking a server-side application into making HTTP requests to an arbitrary domain of the attacker's choosing, often targeting internal network resources or cloud metadata services. In this scenario, the attack vector is client-side, where malicious JavaScript executes within the end-user's browser after accessing an uploaded file from S3. The S3 server itself is not coerced into making unauthorized requests, distinguishing this from a true SSRF vulnerability.
- ✗
Insecure Direct Object Reference (IDOR)
Why it's wrong here
Insecure Direct Object Reference (IDOR) vulnerabilities arise when an application exposes a direct reference to an internal implementation object, such as a file or database key, and fails to verify user authorization to access that object. The described attack leverages a publicly accessible S3 bucket to serve malicious content, meaning the bucket itself and the uploaded object are intentionally accessible to all. The issue is with the content's malicious nature, not unauthorized access to other private objects via predictable identifiers, which is the hallmark of IDOR.
- ✗
S3 bucket privilege escalation
Why it's wrong here
S3 bucket privilege escalation refers to an attacker gaining higher-level AWS Identity and Access Management (IAM) permissions than initially authorized, for instance, escalating from read-only access to full administrative control over an S3 bucket or other AWS services. While serving malicious content from a public S3 bucket is a significant security flaw, it does not inherently grant the attacker elevated permissions within the AWS environment. The attack exploits existing public access settings to impact end-users, rather than modifying the attacker's AWS privileges.
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
Courseiva writes every CEH question from scratch — 870 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CEH practice question is part of Courseiva's free EC-Council certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CEH exam.