Skip to content

Fix program fetching failing on VDP programs - #19

Open
rebirth808 wants to merge 1 commit into
yeswehack:masterfrom
rebirth808:fix/vdp-programs-missing-fields
Open

Fix program fetching failing on VDP programs#19
rebirth808 wants to merge 1 commit into
yeswehack:masterfrom
rebirth808:fix/vdp-programs-missing-fields

Conversation

@rebirth808

Copy link
Copy Markdown

Problem

Fetch programs fails with:

Instantiation of [simple type, class yesweburp.api.Program] value failed for JSON property qualifying_vulnerability due to missing (therefore NULL) value for creator parameter

The YesWeHack API returns programs of type vdp-in-app alongside bug-bounty ones, and VDP payloads simply do not contain the qualifying_vulnerability, non_qualifying_vulnerability, public and vpn_active keys. Those are declared as non-nullable constructor parameters without defaults, so jackson-module-kotlin refuses to instantiate Program.

Because fetchPrograms() collects every program detail into one list, a single VDP is enough to break the entire fetch — the extension shows the error and lists nothing at all.

Reproduction

At the time of writing, digital-flanders-vulnerability-disclosure-program is a public VDP that triggers it. Deserializing the detail payloads of all 64 public programs with the released v2.0.2 classes:

63 OK / 1 FAIL   <- digital-flanders-vulnerability-disclosure-program

With this patch applied:

64 OK / 0 FAIL

Bug bounty programs are unaffected: scopes, qualifying/non-qualifying lists, reward grids and currency still deserialize identically.

Fix

Give a safe default to the fields the API may omit, so partial payloads degrade gracefully instead of aborting the whole listing. Pagination, Scope and BusinessUnit get the same treatment, so a future field rename does not take the entire program list down again (the mapper already sets FAIL_ON_UNKNOWN_PROPERTIES to false, this is the symmetric protection for missing ones).

One file, 11 lines, no behaviour change for existing programs.

Notes

Programs of type `vdp-in-app` returned by the YesWeHack API do not carry
the `qualifying_vulnerability`, `non_qualifying_vulnerability`, `public`
and `vpn_active` keys. Those constructor parameters are non-nullable and
have no default value, so jackson-module-kotlin throws:

    Instantiation of [simple type, class yesweburp.api.Program] value
    failed for JSON property qualifying_vulnerability due to missing
    (therefore NULL) value

Since fetchPrograms() loads every program detail into a single list, a
single VDP in the account is enough to make the whole "Fetch programs"
action fail, leaving the extension unusable.

Give the fields that the API may omit a safe default so that partial
payloads deserialize instead of aborting the fetch. Pagination, Scope and
BusinessUnit get the same treatment to keep future API changes from
breaking the whole listing.

Fixes yeswehack#13
Fixes yeswehack#15
Fixes yeswehack#17

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ExFZMZrq2YL6kBoJJtRhhN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't fetch programs because VDP does not have qualifying_vulnerability key

1 participant