moonlight-common-c: Buffer Copy without Checking Size of Input
CVE-2023-42801 is a high-severity buffer copy without checking size of input vulnerability in moonlight-common-c from Moonlight-stream, with a CVSS 3.1 base score of 7.6 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, but only if a user takes part, for example by opening a link or file. There is no confirmed exploitation so far. EPSS estimates a 0.94% chance of exploitation within 30 days, higher than 61% of scored CVEs.
High severity with no evidence of exploitation so far.
What to do
- Update Moonlight to 9.0.0 or 12.0 or 0.10.23, whichever matches your release line, or a later version.
- Update Moonlight Embedded to 2.6.1 or a later version.
- Update Moonlight Tv to 1.6.0 or a later version.
- Read the advisory on github.com for workarounds and exact fixed builds.
- Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.
- Because the attack needs a user to take part, warn users about unexpected links and files related to this product until it is patched.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Moonlight-stream | moonlight-common-c | Not specified in the record | Not stated |
| Moonlight-stream | Moonlight | before 9.0.0; before 12.0; before 0.10.23 | 9.0.0, 12.0, 0.10.23 |
| Moonlight-stream | Moonlight Embedded | before 2.6.1 | 2.6.1 |
| Moonlight-stream | Moonlight Xbox | 1.14.5 and earlier | Not stated |
| Moonlight-stream | Moonlight Tv | before 1.6.0 | 1.6.0 |
| Moonlight-stream | Moonlight Switch | before 0.13.4 | 0.13.4 |
| Moonlight-stream | Moonlight Vita | Not specified in the record | Not stated |
| Moonlight-stream | Moonlight Qt/pc | 5.0.0 and earlier | Not stated |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- NetworkCan be exploited remotely over a network, including the internet.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- NoneNo account or login is needed.
- User interaction
- RequiredA user must take an action such as opening a file or link.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- LowSome restricted data can be read.
- Integrity
- LowLimited modification of data is possible.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:H. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 7.6 | High | CNA (github.com) |
| CVSS 3.1 | 7.6 | High | NVD |
Official description
Moonlight-common-c contains the core GameStream client code shared between Moonlight clients. Moonlight-common-c is vulnerable to buffer overflow starting in commit f57bd745b4cbed577ea654fad4701bea4d38b44c. A malicious game streaming server could exploit a buffer overflow vulnerability to crash a moonlight client. Achieving RCE is possible but unlikely, due to stack canaries in use by modern compiler toolchains. The published binaries for official clients Qt, Android, iOS/tvOS, and Embedded are built with stack canaries, but some unofficial clients may not use stack canaries. This vulnerability takes place after the pairing process, so it requires the client to be tricked into pairing to a malicious host. It is not possible to perform using a man-in-the-middle due to public key pinning that takes place during the pairing process. The bug was addressed in commit b2497a3918a6d79808d9fd0c04734786e70d5954.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Buffer Copy without Checking Size of Input
The product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer.
How developers prevent this class of flaw
- Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, many languages that perform their own memory management, such as Java and Perl, are not subject to buffer overflows. Other languages, such as Ada and C#, typically provide overflow protection, but the protection can be disabled by the programmer. Be wary that a language's interface to native code may still be subject to overflows, even if the language itself is theoretically safe.
- Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. Examples include the Safe C String Library (SafeStr) by Messier and Viega, and the Strsafe.h library from Microsoft. These libraries provide safer versions of overflow-prone string-handling functions.
- Use automatic buffer overflow detection mechanisms that are offered by certain compilers or compiler extensions. Examples include: the Microsoft Visual Studio /GS flag, Fedora/Red Hat FORTIFY_SOURCE GCC flag, StackGuard, and ProPolice, which provide various mechanisms including canary-based detection and range/index checking. D3-SFCV (Stack Frame Canary Validation) from D3FEND discusses canary-based detection in detail.
More Buffer Copy without Checking Size of Input vulnerabilities (CWE-120)
Timeline
- CVE record published.
- Record last changed materially (score, affected products, status or references).
References
Advisories
- github.com/moonlight-stream/moonlight-common-c/security/advisories/GHSA-f3h8-j898-5h5vExploit, Third Party Advisory
Patches and release notes
Technical write-ups (may include proof of concept)
Other vulnerabilities in moonlight-common-c
- 8.8 High severity
- 8.8 High severity
Recent Buffer Copy without Checking Size of Input vulnerabilities
- 8.2 High severity
- 7.5 High severity
- 9.8 Critical severity
- 7.2 High severity
- 7.2 High severity
- 9.8 Critical severity
Spotted an error? Tell us.