Skip to content

Add Challenge mode to SSRF #565

Description

@preetkaran20

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=...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions