Update the SSRF module to support Challenge Mode by adding @ChallengeCard annotations to each exploitable level. See the Design Doc for full context.
What needs to be done
Add @ChallengeCard to each UNSECURE level method in SSRF, and add the corresponding message keys to messages.properties. This is a purely additive change — existing @AttackVector and @VulnerableAppRequestMapping annotations must remain untouched.
Annotation details
@ChallengeCard is a repeatable method-level annotation (@Repeatable``) already present in the codebase at org.sasanlabs.internal.utility.annotations.ChallengeCard`.
It has three fields:
challengeText — a message key (resolved from messages.properties) describing what the user needs to accomplish at this level
hints — an array of @Hint, each with an order (int) and text (message key resolved from messages.properties)
payload — a @Payload with description and value, both message keys resolved from messages.properties
Example of what the annotation usage should look like
@ChallengeCard(
challengeText = "SSRF_VULNERABILITY_LEVEL_1_CHALLENGE",
hints = {
@ChallengeCard.Hint(order = 1, text = "SSRF_VULNERABILITY_LEVEL_1_HINT_1"),
@ChallengeCard.Hint(order = 2, text = "SSRF_VULNERABILITY_LEVEL_1_HINT_2"),
@ChallengeCard.Hint(order = 3, text = "SSRF_VULNERABILITY_LEVEL_1_HINT_3")
},
payload = @ChallengeCard.Payload(
description = "SSRF_VULNERABILITY_LEVEL_1_PAYLOAD_DESCRIPTION",
value = "SSRF_VULNERABILITY_LEVEL_1_PAYLOAD_VALUE"
)
)
@VulnerableAppRequestMapping(
value = LevelConstants.LEVEL_1,
variant = Variant.UNSECURE,
htmlTemplate = "LEVEL_1/Auth"
)
public ResponseEntity<?> ...
Corresponding messages.properties entries
SSRF_VULNERABILITY_LEVEL_1_CHALLENGE=...
SSRF_VULNERABILITY_LEVEL_1_HINT_1=...
SSRF_VULNERABILITY_LEVEL_1_HINT_2=...
SSRF_VULNERABILITY_LEVEL_1_HINT_3=...
Update the SSRF module to support Challenge Mode by adding
@ChallengeCardannotations to each exploitable level. See the Design Doc for full context.What needs to be done
Add
@ChallengeCardto each UNSECURE level method in SSRF, and add the corresponding message keys to messages.properties. This is a purely additive change — existing@AttackVector and @VulnerableAppRequestMappingannotations must remain untouched.Annotation details
@ChallengeCardis a repeatable method-level annotation (@Repeatable``) already present in the codebase atorg.sasanlabs.internal.utility.annotations.ChallengeCard`.It has three fields:
challengeText — a message key (resolved from messages.properties) describing what the user needs to accomplish at this level
hints — an array of
@Hint, each with an order (int) and text (message key resolved from messages.properties)payload — a
@Payloadwith description and value, both message keys resolved from messages.propertiesExample of what the annotation usage should look like
Corresponding messages.properties entries