{
	"id": "6fb2332a-04f2-475c-b47d-0dc79fe9fd82",
	"created_at": "2026-11-26T02:32:56.389519Z",
	"updated_at": "2026-11-26T02:37:41.820258Z",
	"deleted_at": null,
	"sha1_hash": "35bf489476a86d10e9db778be16b5e0c018b5dc8",
	"title": "Analysis of a Remote Code Execution (RCE) Vulnerability in Cobalt Strike 4.7.1",
	"llm_title": "Analysis of a Remote Code Execution (RCE) Vulnerability in Cobalt Strike 4.7.1",
	"authors": "Rio Sherri",
	"file_creation_date": "0001-01-01T00:00:00Z",
	"file_modification_date": "0001-01-01T00:00:00Z",
	"file_size": 76837,
	"plain_text": "https://web.archive.org/web/20230610065529if_/https://securityintelligence.com/posts/analysis-rce-vulnerability-cobalt-strike/\n\nAnalysis of a Remote Code Execution (RCE) Vulnerability in\n\nCobalt Strike 4.7.1\n\nBy By Rio Sherri\n\nArchived: 2026-11-26 02:18:54 UTC\n\nCommand \u0026 Control (C2) frameworks are a very sensitive component of Red Team operations. Often, a Red\n\nTeam will be in a highly privileged position on a target’s network, and a compromise of the C2 framework could\n\nlead to a compromise of both the red team operator’s system and control over beacons established on a target’s\n\nsystems. As such, vulnerabilities in C2 frameworks are high priority targets for threat actors and\n\nCounterintelligence (CI) operations. On September 20, 2022, HelpSystems published an out-of-band patch for\n\nCobalt Strike which stated that there was potential for Remote Code Execution (RCE).\n\nCobalt Strike is one of several third-party C2 frameworks IBM Security X-Force Red leverages to simulate\n\ndifferent threat actors when delivering adversary services for clients. The Adversary Simulation team at IBM\n\nSecurity X-Force Red performed a diligent review of the patch to ensure that there was no impact to our clients\n\nnetworks, data, and systems.\n\nOur analysis proved that RCE was indeed possible and that the update in version 4.7.1 was insufficient to mitigate\n\nthe impact of the vulnerability. We discovered that creating Swing components from user input allows users to\n\ncreate arbitrary Java objects in the class path and invoke their setter methods, which can lead to remote code\n\nexecution in specific cases. X-Force requested a new CVE (CVE-2022-42948) and provided the technical details\n\nof the vulnerability to HelpSystems to aid in the development of a new patch. This post outlines the analysis\n\nprocess conducted to make this evaluation: patch analysis, root cause review and vulnerability weaponization.\n\nOn September 20, 2022, HelpSystems published an out-of-band update for Cobalt Strike to fix an issue discovered\n\nin Cobalt Strike version 4.7. The vulnerability was marked as Cross-Site Scripting (XSS) and was identified with\n\nthe number CVE-2022-39197. Analysis revealed that the XSS vulnerability could be triggered by manipulating\n\nsome client-side UI input fields, by simulating a Cobalt Strike implant check-in or by hooking a Cobalt Strike\n\nimplant running on a host. It was stated in the release notes that this vulnerability could lead to RCE which was\n\nthe impetus for performing this research.\n\nCVE-2022-39197 Patch Analysis\n\nAs a first step in the analysis process, we decompiled the Cobalt Strike Java client application. This allowed us to\n\ndevelop an understanding of where the vulnerability had been identified and how it had been mitigated.\n\nAs stated within the out-of-band patch notes, X-Force identified a function within BeaconC2.class that checks if\n\nthe XSS mitigation flag has been set within the TeamServer properties file.\n\nFurther analysis of how new Cobalt Strike implants are registered within the UI, X-Force identified the XSS\n\nmitigation validation was implemented within BeaconEntry.class.\n\nPage 1 of 5\n\nhttps://web.archive.org/web/20230610065529if_/https://securityintelligence.com/posts/analysis-rce-vulnerability-cobalt-strike/\n\nAnalysis of how the Cobalt Strike implant list is validated before they are presented to the user, X-Force was able\n\nto identify the specific parameters the XSS validator function leverages and the class (CommonHTMLUtils.class)\n\nstoring the validation functions.\n\nX-Force’s analysis of the CommonHTMLUtils class, revealed two validator functions (potentialXSS and\n\npotentialUserNameXSS). It is not clear why HelpSystems implemented two separate validators, one would suffice\n\nto perform input sanitization. Additionally, it should be noted that, while these checks function correctly they are\n\nunnecessarily complex. To successfully render HTML within Java Swing components, the component text has to\n\nstart with \u003chtml\u003e. Any other text will cause the element to render as plain-text. A universal validator could simply\n\ncheck if a string starts with \u003c and return true if it does. Additionally, it would be possible to insert a whitespace as\n\nthe beginning of the text to render those inputs inert instead of dropping them completely.\n\nInitial analysis of the validator functions immediately raised some concerns that the Cobalt Strike RCE\n\nvulnerability was still exploitable after the patch was applied. X-Force Red identified the note field was not\n\nsubject to the input validation which was leveraged to develop a remote code execution (RCE) payload.\n\nAdditionally, any other UI components that could receive data directly from a Cobalt Strike implant would also be\n\nvulnerable to this attack. Such components would include the process list and the file explorer dialog.\n\nSwing Components and HTML support\n\nThe Cobalt Strike interface is built on top of the Java Swing framework. This framework provides developers with\n\na graphical user interface for Java programs. The image below shows the hierarchy of Java Swing components.\n\nX-Force discovered that it was possible to include HTML code inside a Swing component. If a string’s contents\n\nstarted with the keyword \u003c, the library would parse the content as HTML. The Java code snippet below\n\ndemonstrates this concept.\n\nRunning the code snippet above will create a new JFrame, which contains a JLabel that uses HTML to style the\n\nlabel body. In this case, part of the text is rendered as an HTML heading.\n\nWhile the content is successfully parsed as HTML, the impact in this case is minimal. After testing a variety of\n\nXSS techniques, X-Force noted a unique behavior in the interface after injecting an HTML \u003cobject\u003e tag. The two\n\nred question marks, in the image below, indicated that the label attempted to render the \u003cobject\u003e tag\n\nunsuccessfully.\n\nFurther research revealed that Java components could be included in the malformed string through the use of an\n\nHTML \u003cobject\u003e tag, which could potentially allow for the creation of any Java Swing object. We tested and\n\nconfirmed this by adding a Swing JButton Object which was successfully parsed and rendered, as shown in the\n\nimage below.\n\nA review of the Java SDK showed that the handler for any given HTML.Tag.OBJECT exists within the\n\nObjectView class, which can be found within the HTMLFactory class creation method.\n\nA snippet of the processing logic for the HTML.Tag instance is shown in the image below:\n\nPage 2 of 5\n\nhttps://web.archive.org/web/20230610065529if_/https://securityintelligence.com/posts/analysis-rce-vulnerability-cobalt-strike/\n\nThe function in the ObjectView class responsible for loading the element is called create Compoment(), as shown\n\nin the image below.\n\nThe createCompoment() function will initialize an instance of the specified class and then check if the initialized\n\nobject is an instance of Component. If it is, it will return the object. If it is not, it will call\n\ngetUnloadableRepresentation(). The screenshot below shows this function and explains why X-Force saw two red\n\nquestion marks in our previous test case.\n\nA key component of the ObjectView class is the setParameters() function, which checks whether any parameters\n\nwere specified on the attributes of an HTML element. Next, setParameters() checks whether the class that was\n\nloaded contains any write methods for the HTML element’s parameter and calls the appropriate method within the\n\nclass with the specified value. The full view of setParameters() is shown in the image below.\n\nAs an example of calling a function within a subclass of java.awt.component with just one string parameter,\n\nconsider the following HTML content being sent to the parser.\n\n\u003chtml\u003e \u003cobject classid=“HelloByName”\u003e \u003cparam name=”my_name” value=”Rio”\u003e\u003c/object\u003e\n\nThe parser will try to create an instance of the class HelloByName, check if the class is a subclass of\n\njava.awt.Component, and call the setter method for the my_name parameter. This example demonstrates how the\n\nsett functions can be called with one string parameter in classes that are a subclass of java.awt.Component.\n\nManually searching for a method and class that meets these criteria is non-trivial, but several code analysis tools\n\noffer capabilities to solve this problem in a largely automated manner. For this phase of research, X-Force chose to\n\nuse an open-source code analysis tool called Tabby.\n\nTabby’s main use case is to discover Java deserialization gadgets. It supports several input formats, including Java\n\nJAR files, and can export its analysis to a Neo4j database. Within Neo4j graph database it is possible to use the\n\nCypher query language to identify elements that match specific criteria. This can greatly reduce the search-space\n\nwhen performing code analysis.\n\nX-Force discovered forty-eight functions that met the criteria mentioned earlier. These functions were limited in\n\ncomplexity which allowed X-Force to manually review each of them. Most of these functions were part of the\n\nSwing framework and did not provide anything that  could leverage to trigger RCE. However, X-Force eventually\n\nfound the setURI() function within the JSVGCanvas class, the logic of which is shown in the image below.\n\nThe setURI() function will call the loadSVGDocument function which is used to parse the specified SVG file.\n\nSince SVG files allow a user to insert JavaScript, X-Force crafted the following SVG file and served it from a\n\nlocal web server.\n\nTo test the potential XSS resulting from processing an SVG file, X-Force inserted the HTML listed below in the\n\nnote field on a Cobalt Strike UI.\n\n\u003chtml\u003e\u003cobject classid=\"org.apache.batik.swing.JSVGCanvas\"\u003e\u003cparam name=\"URI\"\n\nvalue=\"http://127.0.0.1:8000/1.svg\"\u003e\u003c/object\u003e\n\nPage 3 of 5\n\nhttps://web.archive.org/web/20230610065529if_/https://securityintelligence.com/posts/analysis-rce-vulnerability-cobalt-strike/\n\nUnfortunately, this test yielded the exception shown below, which indicates that the SVG parser tries to load a new\n\nclass: org.mozilla.java.script.Scriptable. This meant that the XML parser had it is own set of handlers for different\n\ntypes of tags inside SVG XML file.\n\nThis reference to the Batik library in the exception handler led X-Force to Batik’s official documentation, which\n\nexplained how Apache Batik allows developers to call Java code by including a Java JAR file reference within a\n\nSVG script element.\n\nWith the information gained from Batik’s documentation, X-Force built and injected a SVG file containing a\n\ncustom Java code within the note field in the Cobalt strike UI.\n\nFigure 1: Creation of SVG file\n\nFigure 2: Creating a directory to make the directory structure required to initialize\n\nFigure 3: PwnME Java code\n\nFigure 4: Custom Java Manifest file\n\nFigure 5: Compilation of Java code\n\nFigure 6: Injection of SVG file into Cobalt Strike note field\n\nAs shown in the image below, this test successfully triggered the vulnerability and executed /usr/bin/xcalc, which\n\nis a common way to demonstrate a proof-of-concept exploit.\n\nIt should be noted here that this is a very powerful exploitation primitive. Since we can write a payload in Java,\n\nthis means that we can construct a fully featured cross-platform payload that would be able to execute code on the\n\nuser’s machine regardless of the operating system flavor or architecture.\n\nTriggering RCE Through the Beacon\n\nAlthough X-Force could trigger this vulnerability from the perspective of an operator with authenticated access in\n\nthe Cobalt Strike UI, a malicious actor would most likely seek to trigger this vulnerability remotely by\n\nmanipulating a real beacon in memory or simulating such a beacon. As shown in the patch analysis, HelpSystems\n\nintroduced some string-based filters for fields that could be easily tampered by a remote attacker. Public tooling\n\nalready exists to perform such tests, for example CobaltStrikeParser created by Sentinel One.\n\nHowever, as explained in the patch analysis, X-Force realized that the patch was incomplete. A number of areas\n\nwithin the Cobalt Strike UI were not being validated and would thus still allow an attacker to achieve RCE. For\n\nexample, an attacker would still be able to achieve RCE by hooking an implant process and injecting HTML into\n\nthe process name portion of the data structure returned by calls to Process32Next. This data is rendered in the\n\nCobalt Strike UI when an operator requests a graphical process listing. Typically, however, operators tend to favor\n\nrunning the ps command in the Cobalt Strike console in place of opening the graphical menu interface.\n\nAnother area that remained vulnerable was the graphical file explorer menu. This presented a much greater threat\n\nsince it is a common workflow for operators to use this feature to explore the operating system or some universal\n\nPage 4 of 5\n\nhttps://web.archive.org/web/20230610065529if_/https://securityintelligence.com/posts/analysis-rce-vulnerability-cobalt-strike/\n\nnaming convention (UNC) based paths. By hooking calls to FindNextFileA within the implant, we were able to\n\nmanipulate the output in a similar fashion to achieve RCE on the Cobalt Strike UI.\n\nTo trigger the exploit, X-Force used Fermion. Fermion is a cross-platform Electron application that leverages\n\nFrida-Node to ease the development of Frida based instrumentation functions.\n\nX-Force used the following JavaScript code to hook the required function and send the malformed file name to the\n\nCobalt Strike UI backend.\n\nThe image below shows Fermion injecting the Cobalt Strike implant process and loading the function\n\ninstrumentation logic.\n\nWhen the operator opens the File Browser of the affected implant, the vulnerability triggers, resulting in the\n\nexecution of arbitrary code as shown in the following image.\n\nDemo\n\nReferences\n\nhttps://mp.weixin.qq.com/s/l5e2p_WtYSCYYhYE0lzRdQ\n\nhttps://github.com/FuzzySecurity/Fermion\n\nhttps://www.javatpoint.com/java-swing\n\nhttp://www.java2s.com/example/java-api/java/beans/propertydescriptor/getwritemethod-0-4.html\n\nhttps://www.agarri.fr/blog/archives/2012/05/11/svg_files_and_java_code_execution/index.html\n\nSource: https://web.archive.org/web/20230610065529if_/https://securityintelligence.com/posts/analysis-rce-vulnerability-cobalt-strike/\n\nPage 5 of 5",
	"extraction_quality": 1,
	"language": "EN",
	"sources": [
		"ETDA"
	],
	"origins": [
		"web"
	],
	"references": [
		"https://securityintelligence.com/posts/analysis-rce-vulnerability-cobalt-strike/"
	],
	"report_names": [
		"analysis-rce-vulnerability-cobalt-strike"
	],
	"threat_actors": [],
	"ts_created_at": 1795660376,
	"ts_updated_at": 1795660661,
	"ts_creation_date": 0,
	"ts_modification_date": 0,
	"files": {
		"pdf": "https://archive.orkl.eu/35bf489476a86d10e9db778be16b5e0c018b5dc8.pdf",
		"text": "https://archive.orkl.eu/35bf489476a86d10e9db778be16b5e0c018b5dc8.txt",
		"img": "https://archive.orkl.eu/35bf489476a86d10e9db778be16b5e0c018b5dc8.jpg"
	},
	"iocs": [
		{
			"type": "cve",
			"value": "CVE-2022-39197",
			"count": 2,
			"flags": [],
			"some_flags": []
		},
		{
			"type": "cve",
			"value": "CVE-2022-42948",
			"count": 1,
			"flags": [],
			"some_flags": []
		},
		{
			"type": "domain",
			"value": "github.com",
			"count": 1,
			"flags": [
				"in_url_host"
			],
			"some_flags": [
				"in_url_host"
			]
		},
		{
			"type": "domain",
			"value": "mp.weixin.qq.com",
			"count": 1,
			"flags": [
				"in_url_host"
			],
			"some_flags": [
				"in_url_host"
			]
		},
		{
			"type": "domain",
			"value": "securityintelligence.com",
			"count": 6,
			"flags": [
				"in_url_host"
			],
			"some_flags": [
				"in_url_host"
			]
		},
		{
			"type": "domain",
			"value": "web.archive.org",
			"count": 6,
			"flags": [
				"in_url_host"
			],
			"some_flags": [
				"in_url_host"
			]
		},
		{
			"type": "domain",
			"value": "www.agarri.fr",
			"count": 1,
			"flags": [
				"in_url_host"
			],
			"some_flags": [
				"in_url_host"
			]
		},
		{
			"type": "domain",
			"value": "www.java2s.com",
			"count": 1,
			"flags": [
				"in_url_host"
			],
			"some_flags": [
				"in_url_host"
			]
		},
		{
			"type": "domain",
			"value": "www.javatpoint.com",
			"count": 1,
			"flags": [
				"in_url_host"
			],
			"some_flags": [
				"in_url_host"
			]
		},
		{
			"type": "ipv4",
			"value": "127.0.0.1",
			"count": 1,
			"flags": [
				"in_url_host",
				"non_global"
			],
			"some_flags": [
				"in_url_host",
				"non_global"
			]
		},
		{
			"type": "url",
			"value": "http://127.0.0.1:8000/1.svg",
			"count": 1,
			"flags": [],
			"some_flags": []
		},
		{
			"type": "url",
			"value": "https://github.com/FuzzySecurity/Fermion",
			"count": 1,
			"flags": [],
			"some_flags": []
		},
		{
			"type": "url",
			"value": "https://mp.weixin.qq.com/s/l5e2p_WtYSCYYhYE0lzRdQ",
			"count": 1,
			"flags": [],
			"some_flags": []
		},
		{
			"type": "url",
			"value": "https://securityintelligence.com/posts/analysis-rce-vulnerability-cobalt-strike/",
			"count": 6,
			"flags": [
				"in_url_path"
			],
			"some_flags": [
				"in_url_path"
			]
		},
		{
			"type": "url",
			"value": "https://web.archive.org/web/20230610065529if_/https://securityintelligence.com/posts/analysis-rce-vulnerability-cobalt-strike/",
			"count": 6,
			"flags": [],
			"some_flags": []
		},
		{
			"type": "url",
			"value": "https://www.agarri.fr/blog/archives/2012/05/11/svg_files_and_java_code_execution/index.html",
			"count": 1,
			"flags": [],
			"some_flags": []
		},
		{
			"type": "url",
			"value": "https://www.javatpoint.com/java-swing",
			"count": 1,
			"flags": [],
			"some_flags": []
		},
		{
			"type": "url",
			"value": "http://www.java2s.com/example/java-api/java/beans/propertydescriptor/getwritemethod-0-4.html",
			"count": 1,
			"flags": [],
			"some_flags": []
		}
	]
}