Skip to content

Commit ebe6b8d

Browse files
committed
Add test for security_advisory
1 parent c271d4f commit ebe6b8d

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

github/github_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,16 @@ func TestWebhooks(t *testing.T) {
453453
"X-Hub-Signature": []string{"sha1=df442a8af41edd2d42ccdd997938d1d111b0f94e"},
454454
},
455455
},
456+
{
457+
name: "SecurityAdvisoryEvent",
458+
event: SecurityAdvisoryEvent,
459+
typ: SecurityAdvisoryPayload{},
460+
filename: "../testdata/github/security-advisory.json",
461+
headers: http.Header{
462+
"X-Github-Event": []string{"security_advisory"},
463+
"X-Hub-Signature": []string{"sha1=6a71f24fa69f55469843a91dc3a5c3e29714a565"},
464+
},
465+
},
456466
{
457467
name: "StatusEvent",
458468
event: StatusEvent,
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"action": "published",
3+
"security_advisory": {
4+
"ghsa_id": "GHSA-rf4j-j272-fj86",
5+
"summary": "Moderate severity vulnerability that affects django",
6+
"description": "django.contrib.auth.forms.AuthenticationForm in Django 2.0 before 2.0.2, and 1.11.8 and 1.11.9, allows remote attackers to obtain potentially sensitive information by leveraging data exposure from the confirm_login_allowed() method, as demonstrated by discovering whether a user account is inactive.",
7+
"severity": "moderate",
8+
"identifiers": [
9+
{
10+
"value": "GHSA-rf4j-j272-fj86",
11+
"type": "GHSA"
12+
},
13+
{
14+
"value": "CVE-2018-6188",
15+
"type": "CVE"
16+
}
17+
],
18+
"references": [
19+
{
20+
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-6188"
21+
}
22+
],
23+
"published_at": "2018-10-03T21:13:54Z",
24+
"updated_at": "2018-10-03T21:13:54Z",
25+
"withdrawn_at": null,
26+
"vulnerabilities": [
27+
{
28+
"package": {
29+
"ecosystem": "pip",
30+
"name": "django"
31+
},
32+
"severity": "moderate",
33+
"vulnerable_version_range": ">= 2.0.0, < 2.0.2",
34+
"first_patched_version": {
35+
"identifier": "2.0.2"
36+
}
37+
},
38+
{
39+
"package": {
40+
"ecosystem": "pip",
41+
"name": "django"
42+
},
43+
"severity": "moderate",
44+
"vulnerable_version_range": ">= 1.11.8, < 1.11.10",
45+
"first_patched_version": {
46+
"identifier": "1.11.10"
47+
}
48+
}
49+
]
50+
}
51+
}

0 commit comments

Comments
 (0)