Hacking HP Display Monitors via Monitor Control Command Set (CVE-2023-5449)
The theft deterrence PIN on HP monitors was stored in read-write VCP controls, allowing an attacker to read the PIN and disable the anti-theft mechanism. An attacker with physical access could unlock a stolen monitor.
spaceraccoon.dev
Published on spaceraccoon.dev
Have you ever wondered how display monitor software can change various settings like brightness over a simple display cable? As it turns out, this relies on a standard protocol that can lead to interesting vulnerabilities.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
Display monitors expose a surprising amount of control surface over a single cable. The standard behind it is the Monitor Control Command Set (MCCS), published by the Video Electronics Standards Association (VESA). MCCS runs over the lower-level Display Data Channel Command Interface (DDC/CI) standard, which can be implemented on cables such as HDMI. This is what lets a host change brightness, contrast and similar settings without special drivers.
Within MCCS, each setting is a Virtual Control Panel (VCP) code. MCCS defines three types of VCP controls:
- Continuous: values from 0 to a specified maximum, such as brightness (0 to 100).
- Non-continuous: values within a limited set (an enum or boolean), such as colour preset.
- Table: blocks of data (custom structs). For example, the "Source Timing Mode" VCP has a 5 byte data structure: flags for DMT timing modes (0), flags for CEA DTV timing modes (1), CVT descriptor bytes (2-4).
Controls can also be read-only, write-only or read-write, which matters later. MCCS pre-defines common VCP controls from code 0x00 to 0xDF and allocates 0xE0 through 0xFF to manufacturers for their own controls. The standard itself warns that these manufacturer codes carry a risk of incompatibility and unpredictable behaviour, and recommends using them with caution and only when strictly necessary.
HP used that manufacturer space for a theft deterrence feature in its display monitors, and the implementation of that feature is where CVE-2023-5449 lives.
Setup
The entry point was HP Display Center, the vendor's monitor control software. On the researcher's machine Windows auto-installed it without any prompts, likely because it is a trusted Windows Store application. HP Display Center could still interact with and control basic settings such as brightness even when the connected monitor came from a different manufacturer.
The software is a .NET Framework application, which made it straightforward to reverse into close-to-original C# code. The tooling used for the exploitation step was the Rust ddcset project (https://github.com/arcnmx/ddcset-rs), which makes it easy to manipulate messages sent over DDC/CI and is a good base for custom tooling and fuzzers.
Finding it
Inside the decompiled code, a few functions stood out because they were called whenever a display setting changed, for example ExecuteSetVcp. Those functions in turn called lower-level Windows APIs that presumably handled the hardware-level communication. Searching on the name led to Virtual Control Panel, and from there to MCCS.
Windows exposes the following API for setting a writeable VCP control:
_BOOL SetVCPFeature(
[in] HANDLE hMonitor, // handle to display monitor instance
[in] BYTE bVCPCode, // VCP control code
[in] DWORD dwNewValue // New VCP control code value
);
With only 16 manufacturer-specific codes available, HP needed a way to fit more controls into that space. For continuous controls the codes followed the usual <VCP CODE> <VALUE> pattern. For non-continuous controls that wastes bytes, since an enum typically takes only a handful of values out of the 256 a byte can hold. HP's solution was to create sub-VCP codes inside a single catch-all VCP code. Setting that control could mean SetColorProfileGaming (0), SetColorProfileMovie (1), SetColorProfileWarm (2), SetColorProfileCool (3), and then additional non-continuous controls such as SetScreenOrientation0 (4), SetScreenOrientation90 (5), SetScreenOrientation180 (6), and so on. Many non-continuous controls thus consume only one proprietary code.
Reversing the codes from firmware was impractical: the firmware largely contained monitor chipset-specific (Genesis) instructions, and earlier research by Red Balloon Security into a proprietary "GProbe" protocol running over DDC convinced the researcher not to take that route. Reversing the client software was easier: function names, dynamic debugging while using the GUI, and logging messages revealed what the VCP codes did.
One feature visible in the GUI was HP's theft deterrence mechanism. A user can set a 4-to-6 digit PIN on the monitor; if the monitor is stolen and connected to a new computer without the PIN being entered, after 5 minutes the screen dims and shows the message "Theft Mode is Enabled".
The feature is backed by four control commands:
- TheftTimeOut (251): continuous value, the time in minutes before the anti-theft mechanism triggers if no PIN is entered.
- TheftLowPin (252): continuous value, the low 3 digits of the PIN.
- TheftHighPin (253): continuous value, the high 3 digits of the PIN.
- TheftDeterrence (250): non-continuous value, the status of the mechanism. Can be TheftDisabled (0), TheftEnabledConsumer (1) or TheftEnabledEnterPrise (2).
When anti-theft deterrence is turned on, HP Display Center takes the PIN from the user and sends these write MCCS commands:
- TheftLowPin = LowPin: the monitor sets LowPin.
- TheftHighPin = HighPin: the monitor sets HighPin.
- TheftDeterrence = TheftEnabledConsumer: the monitor turns on anti-theft deterrence.
When it is turned off, it sends:
- TheftLowPin = LowPin: the monitor checks LowPin.
- TheftHighPin = HighPin: the monitor checks HighPin.
- TheftDeterrence = TheftDisabled: if the previous two steps checked out, the monitor turns off anti-theft deterrence.
On the firmware side, TheftDeterrence is correctly configured as read-only (RO) until the monitor has received correct TheftLowPin and TheftHighPin commands. The problem is that TheftLowPin and TheftHighPin are not write-only (WO) as they should be: they are read and write (RW). That means an attacker can read the PIN values even after anti-theft deterrence has been triggered.
HP's implementation interprets read and write loosely. When unlocking the monitor, PIN values are sent with a write command, but those values do not overwrite the stored PIN; a write command is simply the mechanism MCCS provides for sending values at all.
Exploitation
For a simple bug like this, the messages can be sent directly with ddcset.
Step 1: enable theft deterrence with a known PIN
Using HP Display Center, go to the Advanced tab, set the PIN to 123123 and enable anti-theft deterrence.
Step 2: simulate the theft
Plug the monitor into another computer. There are 5 minutes before the anti-theft deterrence is triggered.
Step 3: read the low half of the PIN
ddcset -b winapi getvcp 252
This reads VCP code 252, TheftLowPin. It should return:
Display on winapi:
ID: Generic PnP Monitor
Feature 0xfc = 123 / 65535
The Feature 0xfc line is VCP 252 in hexadecimal, and the value 123 is the low three digits of the PIN that was set in step 1.
Step 4: read the high half of the PIN
ddcset -b winapi getvcp 253
This reads VCP code 253, TheftHighPin, and should return the same values.
Step 5: unlock the "stolen" monitor
At this point the PIN has been read from a monitor that was supposed to be locked. If anti-theft deterrence has triggered, entering the leaked PIN in HP Display Center unlocks it.
Root cause
The theft deterrence design depends on the PIN being unreadable while the monitor is locked. TheftDeterrence is correctly read-only until the correct TheftLowPin and TheftHighPin commands have been received, so the lock state itself cannot be flipped by an attacker. But TheftLowPin and TheftHighPin are exposed as read-write instead of write-only, so the values the lock is meant to protect can simply be read back over DDC/CI.
Impact
An attacker who can send DDC/CI commands to the monitor can read the anti-theft PIN and use it to unlock the monitor. Theft deterrence is a deterrent, not a strong control, and the report frames this as a simple vulnerability. The researcher notes that it only scratches the surface of what proprietary MCCS VCP controls may expose, particularly table type values, which are likelier to trigger memory corruption issues. As VESA warns, malformed use of manufacturer codes can lead to permanent damage of monitors. As monitors add features in both hardware and software, such as integrated webcams, more serious vulnerabilities in this space seem likely.
Fix
HP coordinated disclosure with the researcher and published the issue as CVE-2023-5449. The report does not describe the specific code change.
Variants to test
- Read back every manufacturer-specific VCP code (0xE0 to 0xFF) on a monitor that exposes a security-relevant setting, such as a lock, PIN or access control. A positive result is a
getvcpreturning a value that the vendor documentation or client software treats as secret. - Enumerate sub-VCP codes inside a catch-all proprietary control by walking the value range with
setvcpand observing the monitor's behaviour or the client's logs. A positive result is a value that changes a setting the client never exposes in its GUI. - Fuzz table type VCP controls with oversized or malformed data structures. A positive result is a crash, a hang or a monitor that needs a power cycle, which suggests memory corruption rather than a logic flaw.
- Test whether a locked or restricted state can be bypassed by writing the check values directly, without the vendor client, on other monitor brands that implement similar PIN or lock features over MCCS.
What happened, in plain words
A security researcher noticed that a piece of software called HP Display Center had been installed on their Windows computer without them asking for it. This software lets you change settings on a display monitor, such as brightness, from your computer instead of using buttons on the monitor itself. The researcher found that the software could even control some basic settings on monitors made by other companies.
Curious, they opened up the software to see how it worked. In doing so they discovered a feature HP calls "theft deterrence": you can set a PIN on the monitor, and if the monitor is stolen and plugged into a different computer, after a few minutes the screen dims and shows a message saying theft mode is enabled. The idea is that a thief cannot use the monitor normally.
The researcher found a flaw in how that PIN is stored and protected. The monitor is supposed to keep the PIN secret, but it actually lets anyone who can talk to it over the display cable read the PIN back out. So a thief, or anyone with the monitor and a computer, can simply ask the monitor for the PIN, then type it in and unlock the monitor. The flaw was reported to HP and published as CVE-2023-5449.
This article walks through how the researcher got there, what the underlying standard is, and how the PIN can be read, in the same order as the original write-up.
Background: how software talks to a monitor
Display monitor software
A monitor is not just a screen. It has a small computer inside it that handles settings like brightness, contrast and colour. Your computer can send it instructions over the same cable that carries the picture. That is why you can change brightness from a menu on your computer rather than reaching for buttons on the monitor.
HP Display Center is HP's program for doing exactly that. On the researcher's machine, Windows installed it automatically, without asking. The likely reason is that it came from the Microsoft Store, which Windows treats as a trusted source. The researcher then noticed something odd: even when a monitor from a different manufacturer was connected, HP Display Center could still change basic settings such as brightness.
That raised a question: how does the software talk to the monitor at all? To answer it, the researcher looked inside the program. HP Display Center is written in .NET Framework, a Microsoft programming platform. In that recovered code, the researcher spotted functions with names like ExecuteSetVcp, which were called every time a display setting changed. Those functions in turn called lower-level Windows functions that presumably did the actual talking to the hardware.
A few web searches on the name Vcp led to "Virtual Control Panel". In the standard that monitors use, each VCP is one specific setting: a brightness VCP, a contrast VCP, and so on. To understand what that means, the researcher first had to understand the standard itself.
Monitor Control Command Set (MCCS)
Why can you plug almost any monitor into almost any computer and have it work, without changing cables or installing special drivers? Because of standards published by the Video Electronics Standards Association, or VESA. VESA is the same organisation behind the VESA mount, the square hole pattern on the back of many monitors. Beyond physical standards, VESA also writes standards for how monitors and computers communicate, and MCCS is one of them.
MCCS describes how a computer connected to a monitor can control it with commands. It does not run on its own: it sits on top of a lower-level standard called the Display Data Channel Command Interface, or DDC/CI, which can be carried over cables such as HDMI. Think of MCCS as the language and DDC/CI as the postal service that delivers the letters.
MCCS defines three kinds of VCP control:
- Continuous: a number from 0 up to some maximum. Brightness, for example, goes from 0 to 100. Think of a dimmer switch.
- Non-continuous: a value from a small fixed list, like an on/off switch or a choice between a few options. A colour preset is an example.
- Table: a block of data with a defined structure. For example, the "Source Timing Mode" VCP carries a 5 byte structure: flags for DMT timing modes in byte 0, flags for CEA DTV timing modes in byte 1, and CVT descriptor bytes in bytes 2 to 4. The researcher admits these acronyms were not worth looking up.
Each control can also be read-only, write-only, or read-write. That detail matters later: a setting that should be secret must not be readable.
MCCS already defines many common controls, using codes from 0x00 to 0xDF. The notation 0x means the number is written in hexadecimal, base 16, where the letters A to F stand for the values 10 to 15. The standard also sets aside codes 0xE0 through 0xFF for manufacturers to define their own controls, for functions the standard does not cover or that a vendor wants to keep proprietary.
The standard itself warns about this. In its own words:
The 32 control codes E0h through FFh have been allocated to allow manufacturers to issue their own specific controls either where the defined VCP codes do not provide a required function or where the added function is considered proprietary.
Caution: Use of these codes has the risk of causing incompatibility and / or unpredictable behaviour. Example: Consider the case when two display manufacturers choose to use the same ‘manufacturer VCP code’ for different functions (or different implementations of the same function) but the user chooses not to use the specific software support supplied or recommended for his particular display, he may use a general purpose MCCS support application, native support built into the operating system or a MCCS support application intended for a different display model. In this case, the resulting behaviour is unpredictable, ranging from no support for the function which uses a ‘manufacturer VCP code’ to incorrect control and adjustment of the function. In all cases this will likely result in an annoyed user and a service call, in extreme cases it may result in a situation where the user cannot return the display to normal operation.
It is recommended that these codes are used with caution and only when strictly necessary.
In plain terms: two manufacturers might use the same code number for two completely different things, and software written for one monitor might do something strange or harmful on another. The standard recommends using these codes sparingly.
Despite that warning, vendors tend to stretch standards to make their products stand out, just as the researcher found with the iCalendar standard in an earlier project. Monitors today do far more than show pictures: some include webcams, microphones and other features.
Some of what a monitor supports is announced at startup in a capability string, a message the monitor sends to the computer listing which VCP controls it has. The software reads this so it knows what it can offer the user.
HP's proprietary VCP codes
Only 16 codes, 0xE0 to 0xFF, are reserved for manufacturers. That is not much room for new features. HP came up with a clever way around the limit.
For continuous controls, HP followed the usual pattern: a VCP code followed by a value. But for non-continuous controls, that wastes space. If a setting is a choice between a few options, such as colour profiles Gaming (0), Movie (1), Warm (2) and Cool (3), a whole byte can hold 256 values but only four are used.
So for proprietary non-continuous controls, HP created sub-VCP codes inside one catch-all VCP code. Setting that one control could mean SetColorProfileGaming (0), SetColorProfileMovie (1), SetColorProfileWarm (2), SetColorProfileCool (3), and then additional non-continuous controls such as SetScreenOrientation0 (4), SetScreenOrientation90 (5), SetScreenOrientation180 (6), and so on. Instead of each non-continuous control using up one of the precious manufacturer codes, many of them share a single code. Think of one drawer with many labelled compartments instead of many separate drawers.
Theft deterrence
Reading these codes directly out of the monitor's firmware was hard. The firmware mostly contained instructions specific to the monitor's chipset, made by Genesis, and earlier research by Red Balloon Security into a proprietary "GProbe" protocol that also ran over DDC convinced the researcher not to go that way.
Instead, the researcher reversed the client software, which was much easier. Function names, watching the program while clicking through its interface (dynamic debugging), and log messages together revealed what each VCP code did.
One feature stood out in the interface: HP's theft deterrence mechanism. A user can set a 4-to-6 digit PIN on the monitor. If the monitor is stolen and connected to a new computer without the PIN being entered, after 5 minutes the screen dims and shows the message "Theft Mode is Enabled".
To support this, HP uses four control commands:
- TheftTimeOut (251): a continuous value, the number of minutes before the anti-theft mechanism triggers if no PIN is entered.
- TheftLowPin (252): a continuous value, the low 3 digits of the PIN.
- TheftHighPin (253): a continuous value, the high 3 digits of the PIN.
- TheftDeterrence (250): a non-continuous value, the status of the mechanism. It can be TheftDisabled (0), TheftEnabledConsumer (1) or TheftEnabledEnterPrise (2).
When anti-theft deterrence is turned on, HP Display Center takes the PIN from the user and sends these write commands:
- TheftLowPin = LowPin: the monitor sets LowPin.
- TheftHighPin = HighPin: the monitor sets HighPin.
- TheftDeterrence = TheftEnabledConsumer: the monitor turns on anti-theft deterrence.
When it is turned off, it sends:
- TheftLowPin = LowPin: the monitor checks LowPin.
- TheftHighPin = HighPin: the monitor checks HighPin.
- TheftDeterrence = TheftDisabled: if the previous two steps checked out, the monitor turns off anti-theft deterrence.
On the monitor's side, TheftDeterrence is correctly configured as read-only (RO) until the monitor has received the correct TheftLowPin and TheftHighPin commands. In other words, an attacker cannot simply flip the lock off, because the monitor will not accept a change to that setting until it has seen the right PIN.
The problem is with the two PIN halves. TheftLowPin and TheftHighPin should be write-only (WO): you should be able to send a value to check it, but never read it back. Instead they are read and write (RW). That means an attacker can read the PIN values even after anti-theft deterrence has been triggered.
HP's implementation treats read and write loosely. When unlocking the monitor, the PIN values are sent with a write command, but those values do not overwrite the stored PIN. A write command is simply how MCCS sends values at all; it does not always mean "store this".
MCCS fuzzing and exploitation
To send the malicious series of commands, you still need to use low-level functions to talk to the monitor. Writing that from scratch in C++ is a hassle. Fortunately, a Rust project called ddcset (https://github.com/arcnmx/ddcset-rs) already makes it easy to build and send messages over DDC/CI. It is a good base for your own tools and fuzzers. Fuzzing means feeding a program or device unexpected inputs to see whether it misbehaves.
For a simple bug like this one, the messages can be sent directly.
- Using HP Display Center, go to the Advanced tab, set the PIN to
123123and enable anti-theft deterrence. - Plug the monitor into another computer. You have 5 minutes before the anti-theft deterrence is triggered.
- Run
ddcset -b winapi getvcp 252to read TheftLowPin. It should return:
Display on winapi:
ID: Generic PnP Monitor
Feature 0xfc = 123 / 65535
- Run
ddcset -b winapi getvcp 253to read TheftHighPin. It should also return the same values. - This shows that you have successfully read the PIN from a "stolen" monitor. If anti-theft deterrence is triggered, simply enter the leaked PIN using HP Display Center.
Here is what each step is doing and why.
Step 1 sets up the situation.
Step 2 simulates a theft. The whole point of the feature is that a monitor moved to a new computer should lock itself. Unplugging it and connecting it elsewhere is the simplest way to reproduce that.
Step 3 is the actual attack. The command is:
ddcset -b winapi getvcp 252
Line by line:
ddcsetis the name of the tool.-b winapitells it which backend to use for talking to the monitor. A backend is the layer that actually sends the messages;getvcpis the action: read the value of a VCP control.252is the VCP code to read, which is TheftLowPin, the low three digits of the PIN.
The output is:
Display on winapi:
ID: Generic PnP Monitor
Feature 0xfc = 123 / 65535
Line by line:
Display on winapi:says which display and backend were used.ID: Generic PnP Monitoris the name Windows gives the monitor. PnP stands for Plug and Play, the system that lets Windows recognise hardware automatically.Feature 0xfc = 123 / 65535is the important line.0xfcis 252 written in hexadecimal, so this is the TheftLowPin control.123is the value read back, which is the low three digits of the PIN set in step 1.
Step 4 repeats the same thing for the other half of the PIN:
ddcset -b winapi getvcp 253
getvcp 253reads VCP code 253, TheftHighPin, the high three digits of the PIN.- The output should match the previous one.
Step 5 uses the result. The PIN has now been read from a monitor that was supposed to be locked. If the theft deterrence has triggered, typing the leaked PIN into HP Display Center unlocks the monitor.
Conclusion
The researcher coordinated disclosure with HP, meaning they told HP about the problem and agreed on when to make it public, and the issue was published as CVE-2023-5449. CVE stands for Common Vulnerabilities and Exposures: a public catalogue entry that gives a security flaw a unique number so people can refer to it unambiguously.
It was interesting to see how much harder it is to patch hardware, especially specialised hardware like display monitors, than software.
This simple vulnerability only scratches the surface of more interesting bugs that can be found in proprietary MCCS VCP controls. Table type values are especially promising, because they are more likely to trigger memory corruption issues. Memory corruption is a class of bug where a program writes data outside the space it reserved, which can crash it or let an attacker take control. As VESA warns, malformed use of manufacturer codes can even lead to permanent damage to monitors.
As monitors add more features in both hardware and software, such as integrated webcams, the researcher expects more serious vulnerabilities to emerge in this space.
Glossary
- API: Application Programming Interface, a defined set of functions one program offers so another program can ask it to do things, like a menu of services.
- Backend: the part of a tool that actually carries out an action, here the layer that sends messages to the monitor.
- Capability string: a message a monitor sends at startup listing which controls it supports.
- Continuous control: a VCP setting that takes a number in a range, such as brightness from 0 to 100.
- CVE: Common Vulnerabilities and Exposures, a public catalogue that gives each security flaw a unique identifier.
- DDC/CI: Display Data Channel Command Interface, the lower-level standard that carries control messages between a computer and a monitor over cables such as HDMI.
- Dynamic debugging: watching a running program and its internal state while using it, to learn what it does.
- Firmware: the software built into a device, such as the code running inside a monitor.
- Fuzzing: feeding a program or device unexpected or malformed inputs to find bugs.
- Hexadecimal: a base-16 way of writing numbers, where 0xfc means 252.
- MCCS: Monitor Control Command Set, the VESA standard that defines how a computer controls a monitor's settings.
- Memory corruption: a bug where a program writes data outside the memory it reserved, which can crash it or be exploited.
- Non-continuous control: a VCP setting that takes one value from a small fixed list, like an on/off switch or a colour preset.
- PIN: Personal Identification Number, a short numeric code used to prove you are allowed to do something.
- Plug and Play (PnP): the system that lets a computer recognise connected hardware automatically.
- Read-only (RO): a setting that can be read but not changed.
- Read-write (RW): a setting that can be both read and changed.
- Reverse engineering: taking a finished program apart to understand how it works, often recovering close-to-original code.
- Sub-VCP code: HP's technique of packing many non-continuous controls into one VCP code by giving each option its own value.
- Table control: a VCP setting that carries a structured block of data rather than a single number.
- Theft deterrence: HP's feature that locks a monitor with a PIN if it is moved to a new computer.
- VCP: Virtual Control Panel, the MCCS concept where each monitor setting has its own code.
- VESA: Video Electronics Standards Association, the organisation behind standards such as MCCS and the VESA mount.
- Write-only (WO): a setting that can be sent a value but not read back, which is what a secret like a PIN should be.
- .NET Framework: a Microsoft platform for building and running programs, whose programs can often be reversed into near-original code.