[{"id":"websecurityadvanced-001","courseId":"web-security-advanced","domain":"injection-and-input","topic":"XML entity expansion denial of service","prompt":"Your team turned off external entity resolution in its XML parser, which blocks file reads through XXE. A test with a nested-entity payload still exhausts server memory. What does this show?","hint":"Think about what the parser still does with entities once the external lookup is gone.","explain":"An XML parser can resolve entities that refer to other entities, so a small document can balloon in memory. Blocking one kind of lookup covers only one risk, so check what else the parser still does.","source":"https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html","interaction":{"type":"single"},"options":[{"id":"a","text":"Entity expansion is a separate denial-of-service risk, so the app should reject DTDs or limit entity expansion.","why":"Preventing XXE does not prevent every XML denial-of-service attack, so expansion needs its own control."},{"id":"b","text":"Entity expansion only runs when the parser fetches external DTDs, so the test should have failed.","whyNot":"Expansion is not limited to external fetches, so turning off external resolution does not remove it."},{"id":"c","text":"Turning on XInclude processing makes the parser enforce entity limits.","whyNot":"XInclude is kept off unless needed; it loads resources on its own and does not limit expansion."},{"id":"d","text":"Entity expansion is harmless when the parsed output is never sent back to the user.","whyNot":"The resources are consumed inside the parser, whether or not the result is returned."}],"answer":"a","explanation":"Disabling external entity resolution prevents XXE, but entity expansion can still exhaust resources, so DTDs should be rejected or expansion limited.","concept":"Disabling external entity resolution prevents XXE, but entity expansion can still exhaust resources, so DTDs should be rejected or expansion limited.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["Disabling external entities does not stop every XML denial-of-service attack."]},{"id":"websecurityadvanced-002","courseId":"web-security-advanced","domain":"injection-and-input","topic":"Gadget chains in deserialization","prompt":"A .NET team wants to stop gadget chains in untrusted deserialization. Which TWO statements about this are correct?","hint":"Ask when the dangerous work runs relative to your check.","explain":"Deserialization rebuilds live objects from a byte stream, so incoming data can influence which types are built. Each framework's formatter and type-handling settings decide how much control the sender gets.","source":"https://cheatsheetseries.owasp.org/cheatsheets/Deserialization_Cheat_Sheet.html","interaction":{"type":"multiple","tellCount":true},"options":[{"id":"a","text":"Checking the type of an object after Deserialize returns is too late, because code may already have run.","why":"Execution can happen during deserialization itself, so a type check afterward cannot stop a gadget."},{"id":"b","text":"Microsoft has said BinaryFormatter cannot be secured, so it should not be used at all.","why":"Microsoft's guidance is that BinaryFormatter is dangerous and cannot be secured, so it should be avoided."},{"id":"c","text":"Switching to XmlSerializer makes gadget chains impossible, because the types are fixed in code.","whyNot":"If an attacker can steer the type being instantiated, even XmlSerializer or DataContractSerializer can be subverted."},{"id":"d","text":"A type allowlist is enough, since allowed types cannot carry risky properties.","whyNot":"Some allowed types have risky properties, such as an Object-typed Value on ValidationException."},{"id":"e","text":"Setting Json.NET TypeNameHandling to Auto is safe, because JSON payloads are plain text.","whyNot":"The guidance is to keep TypeNameHandling set to None, because a payload could otherwise name the types to build."},{"id":"f","text":"JavaScriptSerializer is safe with a JavaScriptTypeResolver if the resolver only reads type names.","whyNot":"The guidance says not to use JavaScriptSerializer with a JavaScriptTypeResolver at all."}],"answer":"ab","explanation":"Gadget code can run during deserialization, so checks after the fact are too late; BinaryFormatter should be avoided and the stream must not choose the type.","concept":"Gadget code can run during deserialization, so checks after the fact are too late; BinaryFormatter should be avoided and the stream must not choose the type.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["Never let untrusted data choose the type, and avoid BinaryFormatter."]},{"id":"websecurityadvanced-003","courseId":"web-security-advanced","domain":"injection-and-input","topic":"Signing serialized data before reading","prompt":"A queue service signs each serialized job when writing it. Checking the signature before deserializing lets the service reject a tampered job without building any object from it.","hint":"Consider which step builds objects and which step proves the data is authentic.","explain":"Native deserialization turns incoming bytes into objects, and that step can run code. A signature lets a receiver check that bytes match what a trusted writer produced.","source":"https://cheatsheetseries.owasp.org/cheatsheets/Deserialization_Cheat_Sheet.html","interaction":{"type":"true-false"},"options":[{"id":"a","text":"True","why":"Only messages with an authenticated signature are deserialized, so a tampered job never becomes an object."},{"id":"b","text":"False","whyNot":"Checking the signature before deserializing is exactly what stops unauthenticated messages from being rebuilt."}],"answer":"a","explanation":"Signing serialized data and deserializing only messages with an authenticated signature keeps unauthenticated data from ever becoming objects.","concept":"Signing serialized data and deserializing only messages with an authenticated signature keeps unauthenticated data from ever becoming objects.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["Verify a signature before deserializing, not after."]},{"id":"websecurityadvanced-004","courseId":"web-security-advanced","domain":"injection-and-input","topic":"SSRF to cloud metadata endpoints","prompt":"Your service runs on AWS and fetches user-supplied URLs. An attacker uses SSRF to make it call the instance metadata service. What is the main thing the attacker is after?","hint":"Think about what a cloud instance normally asks its metadata service for.","explain":"A cloud instance can query a metadata service at a fixed internal address. SSRF makes the server send that query for an outside caller, so the server's network reach becomes the attacker's.","source":"https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html","interaction":{"type":"single"},"options":[{"id":"a","text":"Credentials and access tokens that the metadata service serves to the instance","why":"SSRF is often used to access and steal credentials and access tokens from metadata services."},{"id":"b","text":"The application's source code, copied from its version control repository","whyNot":"A metadata service does not hold the application's repository, so source code is not what SSRF takes from it."},{"id":"c","text":"The TLS private key of the public load balancer in front of the service","whyNot":"Load balancer keys are not what SSRF against metadata services is used to steal."},{"id":"d","text":"The database admin password stored in the application's config file","whyNot":"A config file is not served by the metadata service, so this is not what the attack takes from it."}],"answer":"a","explanation":"In cloud environments, SSRF is often used to access and steal credentials and access tokens from metadata services such as AWS, Azure and GCP.","concept":"In cloud environments, SSRF is often used to access and steal credentials and access tokens from metadata services such as AWS, Azure and GCP.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["Cloud metadata services are a common SSRF target for credentials and access tokens."]},{"id":"websecurityadvanced-005","courseId":"web-security-advanced","domain":"injection-and-input","topic":"IMDSv2 for AWS metadata","prompt":"After moving an EC2 fleet to IMDSv2 and disabling IMDSv1, user-supplied URL checks against SSRF are no longer needed.","hint":"Ask whether a platform setting can see every URL your application is told to fetch.","explain":"IMDSv2 is a hardened mode of the AWS metadata service, offered as an extra layer against some SSRF attempts. Consider what a platform setting can cover, and what only the application can check.","source":"https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html","interaction":{"type":"true-false"},"options":[{"id":"a","text":"True","whyNot":"IMDSv2 is defense in depth that mitigates some SSRF instances; it does not remove the need to validate URLs."},{"id":"b","text":"False","why":"IMDSv2 mitigates some SSRF instances only, so the application still needs its own URL validation."}],"answer":"b","explanation":"IMDSv2 is defense in depth that mitigates some SSRF instances; it does not replace application-level validation of URLs.","concept":"IMDSv2 is defense in depth that mitigates some SSRF instances; it does not replace application-level validation of URLs.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["IMDSv2 narrows SSRF impact on AWS but does not replace URL validation."]}]