Skip to content

SwiftTerm Code Injection vulnerability

High severity GitHub Reviewed Published Dec 2, 2022 in migueldeicaza/SwiftTerm • Updated Feb 9, 2024

Package

swift github.com/migueldeicaza/SwiftTerm (Swift)

Affected versions

< 1.2.0

Patched versions

1.2.0

Description

Impact

Attacker could modify the window title via a certain character escape sequence and then insert it back to the command line in the user's terminal, e.g. when the user views a file containing the malicious sequence, which could allow the attacker to execute arbitrary commands.

Credit

These bugs were found and disclosed by David Leadbeater dgl@dgl.cx (@dgl at github.com)

Patches

Fixed in version ce596e0dc8cdb288bc7ed5c6a59011ee3a8dc171

Workarounds

There are no workarounds available

References

Similar exploits to this existed in the past, for terminal emulators:

https://nvd.nist.gov/vuln/detail/CVE-2003-0063
https://nvd.nist.gov/vuln/detail/CVE-2008-2383

Additional background and information is also available:

https://marc.info/?l=bugtraq&m=104612710031920&w=2
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=510030

References

@migueldeicaza migueldeicaza published to migueldeicaza/SwiftTerm Dec 2, 2022
Published by the National Vulnerability Database Dec 2, 2022
Published to the GitHub Advisory Database Jul 14, 2023
Reviewed Jul 14, 2023
Last updated Feb 9, 2024

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Changed
Confidentiality
High
Integrity
Low
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N

EPSS score

0.062%
(27th percentile)

Weaknesses

CVE ID

CVE-2022-23465

GHSA ID

GHSA-jq43-q8mx-r7mq
Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.