Posts Tagged ‘cpld program crack’
The Programmer Knows Everything: Firmware, Algorithms, Logs
The device has a lock bit, a debug lock and a fuse. The equipment that programs it has a USB port and a folder of files. Any assessment that treats the device as the security boundary has assessed the harder target and ignored the easier one.
A programming system is three assets in one box: the data it burns, the algorithm it uses to burn it, and the record of what it has burned. Each has a different value and each is usually less protected than the chip.
Asset one: the image
A standalone programmer — one that does not need a PC, used for field updates or small production runs — stores the image in its own memory. That memory is a flash chip on a board inside a plastic case, and it is readable with a clip.
The image is stored in whatever form the programmer uses, which may be the raw image, a compressed image, or a container with the programming parameters attached. Even in the last case, the image is there.
| Programmer type | Image location | Readability |
|---|---|---|
| PC-hosted, file loaded per run | The PC’s filesystem | Depends on the PC |
| Standalone with internal storage | A flash chip inside the unit | Readable with a clip |
| Networked production programmer | A server or an internal store | Depends on the network |
| Gang programmer | Internal storage per socket | Readable |
The second row is the common case for field service equipment, and it is the most exposed. A programmer that a service technician carries in a van contains the firmware of every product the technician services.
Asset two: the algorithm
The algorithm is the part with the most commercial value and the least obvious location.
In a PC-hosted system it is in the vendor’s software: a dynamic library, a data file with the algorithm parameters, or a firmware blob that is uploaded to the programmer’s hardware. In a standalone system it is in the same internal flash as the image.
| Form | Location | Value |
|---|---|---|
| Algorithm description file | The vendor’s software directory | High; describes the sequence |
| Firmware blob uploaded per operation | The software, or the programmer | High; is the sequence |
| Device-specific parameters | A configuration file | Medium; the timings |
| Generic algorithm | Hard-coded in the software | Low; replaceable |
The first row is the one that matters for a customer who wants to program devices with different equipment. An algorithm description file is a text or binary description of the command sequence and timings, and extracting it is a file copy rather than an attack. Its significance is the same as the specification described in what “program” means.
Asset three: the log
The log is the least valuable asset individually and the most revealing in combination.
A production programmer records each operation: timestamp, device identifier, file version or hash, result, and often the serial number written into the device. The record is necessary for traceability and it is a description of the production run.
| Log field | What it discloses |
|---|---|
| File hash | Which firmware, and whether it changed |
| Serial number | Which unit is which, and the volume |
| Timestamp | Production rate and schedule |
| Result | Yield, and therefore process quality |
| Operator | Who ran the line |
The second row is the one that creates a problem beyond confidentiality. A log that maps serial numbers to file versions tells anyone who obtains it which units carry a known-vulnerable firmware, which is a targeting list.
Why this is easier than the chip
Three properties make the programming system a softer target than the device.
It is designed to be accessible. A programmer has a USB port, an SD card slot or a network interface, and those exist so that files can be loaded. There is no equivalent of a lock bit.
It is not treated as a secret. The equipment is bought, configured and handed to staff, and the security model is usually physical control of the room rather than any technical measure.
| Property | Device | Programmer |
|---|---|---|
| Accessible interface | Locked | Open by design |
| Contents protected | Often | Rarely |
| Threat model | An attacker with the device | None, usually |
| Replacement cost | Low | High |
The fourth row explains the asymmetry. A device that is compromised is replaced; a programmer that is compromised is a security incident that involves the whole production line, so the equipment is protected physically and not technically.
What the attack looks like
The examination is not destructive and not expensive.
The first step is to identify the equipment and its software version, which is usually written on the case and visible in the software’s about box. The second is to look at what the software stores on disk: a directory listing of the vendor’s folder typically shows the algorithm files, the device database and the logs.
| Step | Action | Output |
|---|---|---|
| One | Identify the equipment and software version | A model and a version |
| Two | Inspect the software directory | Locations of the assets |
| Three | Identify the internal storage of a standalone unit | A candidate flash chip |
| Four | Read the internal storage | The image and the algorithm |
| Five | Correlate the log with production records | A unit-to-firmware map |
The fourth step requires opening the unit, which is a physical intervention on equipment that may be under warranty or under a service contract. That is a commercial consideration rather than a technical one, and it is the reason this route is often described rather than performed.
What the customer should do about it
The measures are procedural and they are cheap.
The first is to treat a programmer as a copy of the firmware and to apply the same controls: inventory, physical control, and a record of who has access.
| Measure | Addresses |
|---|---|
| Inventory of programming equipment | Unknown devices holding images |
| Physical control of the room | Access by staff and visitors |
| Standalone units loaded per job, not permanently | Field equipment carrying everything |
| Log retention policy | Production disclosure |
| Decommissioning procedure | Equipment sold with images inside |
The fifth row is the one that is almost always missing. Programming equipment is retired, sold or scrapped with its internal storage intact, and a second-hand programmer is a device that contains the previous owner’s production.
Where this fits
The process view of the same problem, including the transfer of the programming file and the fate of returned units, is in supply chain leaks.
Where the objective is to program devices without the original vendor’s equipment, the algorithm is what is needed and its extraction is the observation work described in what “program” means. Where the objective is the image, the device itself is usually the easier source, and the routes are in extracting MCU firmware.
What we deliver for this class of assessment is an inventory and a ranking: which equipment holds which images, what an attacker with physical access would obtain, and which measure closes the exposure. We do not perform interventions on equipment under a service contract without the owner’s written instruction, because the commercial consequences of voiding that contract are usually larger than the finding.