Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency in JSON #205

Closed
mister-turtle opened this issue Jun 20, 2020 · 2 comments · Fixed by #220
Closed

Inconsistency in JSON #205

mister-turtle opened this issue Jun 20, 2020 · 2 comments · Fixed by #220

Comments

@mister-turtle
Copy link

The bentley program safe_harbor field is unquoted, and such is treated as a boolean instead of a string.

    {
        "program_name": "Bentley",
        "policy_url": "https://www.bentley.com/responsible_disclosure.pdf",
        "submission_url": "https://www.bentley.com/en/about-us/contact-us/contact-us-form?topic=11",
        "launch_date": "",
        "bug_bounty": true,
        "swag": true,
        "hall_of_fame": true,
        "safe_harbor": true
    },

compared to another program

    {
        "program_name": "Better",
        "policy_url": "https://bugcrowd.com/better",
        "submission_url": "https://bugcrowd.com/better/report",
        "launch_date": "",
        "bug_bounty": true,
        "swag": false,
        "hall_of_fame": true,
        "safe_harbor": "full"
    },

Additionally, there are capitalised and lowercase variants for some of the data.

$ curl https://raw.githubusercontent.com/disclose/disclose/master/program-list/program-list.json 2> 
/dev/null | grep "safe_harbor" | sort -u
        "safe_harbor": ""
        "safe_harbor": "false"
        "safe_harbor": "full"
        "safe_harbor": "none"
        "safe_harbor": "None"
        "safe_harbor": "partial"
        "safe_harbor": "Partial"
        "safe_harbor": true
@mister-turtle
Copy link
Author

Also the hall_of_fame

$ curl https://raw.githubusercontent.com/disclose/disclose/master/program-list/program-list.json 2> /dev/null | grep "hall_of_fame" | sort -u
        "hall_of_fame": "",
        "hall_of_fame": false,
        "hall_of_fame": "true",
        "hall_of_fame": true,

nealmcb added a commit to nealmcb/disclose that referenced this issue Aug 1, 2020
@nealmcb
Copy link
Contributor

nealmcb commented Aug 1, 2020

Note that this repo also includes a schema which lists only these 4 options:

    "safe_harbor": {
        "type": "string",
        "enum": [
            "full",
            "partial",
            "none",
            ""
        ]
    },

And thanks, @knodesec. Here is a variant of your command which gives sorted counts.

curl https://raw.githubusercontent.com/disclose/disclose/master/program-list/program-list.json \
  2>  /dev/null | grep "safe_harbor" | sort | uniq -c | sort -rn
    579     "safe_harbor": ""
    207     "safe_harbor": "partial"
    126     "safe_harbor": "full"
      5     "safe_harbor": "None"
      5     "safe_harbor": "none"
      2     "safe_harbor": "Partial"
      2     "safe_harbor": "false"

So there are 5+2+2 = 9 that don't fit the schema. Assuming that "false" is the same as "none", these should be easy to fix.

For the hall_of_fame entries that are empty (""), I assume the appropriate value is false.

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 a pull request may close this issue.

2 participants