JTAG/SWD debug-port security requires a chip's on-chip JTAG or Serial Wire Debug interface to enforce authentication, a permanent fuse-based lockout, or per-asset debug-level gating, because without one of those controls the same direct read-and-write access to flash, RAM, and CPU execution that a legitimate engineer uses during development is available to anyone who can physically reach the board.
It matters for embedded devices because that interface typically ships enabled on production silicon unless a manufacturer deliberately locks it, and MITRE's CWE-1191 and CWE-1244 weaknesses, plus real device CVEs, show it is routinely left open.
Key takeaways
- JTAG and SWD both reach the same internal debug access port, which can halt the CPU, single-step it, and read or write memory, flash and peripheral registers directly.
- A debug port is not a side channel next to the device's real protections — it is a second, usually unauthenticated front door into the exact same memory and execution state those protections are supposed to guard.
- Storage hardware.
- Each vendor offers a different mix of one-way fuses, erase-to-unlock states and key-based unlock, and the defaults differ.
What do JTAG and SWD actually give a debugger access to?
JTAG and SWD both reach the same internal debug access port, which can halt the CPU, single-step it, and read or write memory, flash and peripheral registers directly. JTAG (IEEE 1149.1) started life as a boundary-scan test standard and was repurposed industry-wide as the wire protocol for on-chip debug, usually needing four to five dedicated pins. SWD (Serial Wire Debug) carries the equivalent traffic over just two pins, which is why it is common on smaller, pin-constrained microcontrollers. MITRE's CWE-1191 groups both under a single "On-Chip Debug and Test Interface" technology category, because the security question is the same regardless of which wires carry it: does the interface check whether the party connected to it is actually authorized to be there.
| Interface | Pin count (typical) | Where it is common |
|---|---|---|
| JTAG (IEEE 1149.1) | 4–5 (TCK, TMS, TDI, TDO, optional TRST) | Larger SoCs, boundary-scan test, multi-core debug |
| SWD (Serial Wire Debug) | 2 (SWCLK, SWDIO) | Cost- and pin-constrained microcontrollers |
Why does an open debug port undermine every other control on the device?
A debug port is not a side channel next to the device's real protections — it is a second, usually unauthenticated front door into the exact same memory and execution state those protections are supposed to guard. MITRE's CWE-1191 states the weakness plainly: "the chip does not implement or does not correctly perform access control to check whether users are authorized to access internal registers and test modes through the physical debug/test interface," with the direct consequence that "a user may be able to bypass on-chip protection mechanisms through the debug interface." CWE-1244 describes a narrower sibling failure — a chip that does support multiple debug access levels but assigns the wrong one to a sensitive asset, leaving it reachable "from untrusted debug agents." NIST SP 800-193 makes the same point from the firmware-update side: its non-bypassability principle (Section 4.2.1.3) warns that "development or diagnostic interfaces that allow access to flash regions" could "create a vulnerability allowing malicious software to modify device firmware with a malicious or invalid image," and calls for "disabling development and diagnostic interfaces in production devices." A signed bootloader, an encrypted filesystem or a hardware root of trust all assume code is only entered through the paths they verify; an open debug port that can halt the CPU and write memory sits underneath all of that verification, not behind it.
Which real devices have shipped with an open debug port?
Ventilators, enterprise SSDs and even hardware security modules have, according to NVD records from 2024 and 2025:
- Medical device. CVE-2024-48970 describes a Baxter Life2000 ventilator whose "microcontroller lacks memory protection," such that "an attacker could connect to the internal JTAG interface and read or write to flash memory using an off-the-shelf debugging tool," scored CVSS 9.3 (Critical).
- Storage hardware. CVE-2024-7726 covers Kioxia CM6/PM6/PM7 enterprise SSDs, where "the 2 main CPU cores of the SoC can be accessed via an open JTAG debug port that is exposed on the drive's circuit board," reachable "without having to open the disk enclosure," giving an attacker with temporary physical access "full access to the firmware and memory... including the execution of arbitrary code... or bypassing the firmware signature verification during boot-up."
- Security hardware itself. CVE-2025-59693 affects Entrust nShield Connect XC/5c hardware security modules, where a "physically proximate attacker" can "obtain debug access and escalate privileges by bypassing the tamper label and opening the chassis without leaving evidence, and accessing the JTAG connector."
None of them required exotic tooling: an off-the-shelf debug probe and physical access to a board were enough. A debug port left open on the network needs even less: CERT@VDE's VDE-2020-016 says an open port used for debugging on SWARCO Traffic Systems' CPU LS4000 with firmware versions starting with G4, "grants root access to the device without access control via network" (CVE-2020-12493, 10.0 per CERT@VDE and NVD).
How do common microcontrollers lock the debug port?
Each vendor offers a different mix of one-way fuses, erase-to-unlock states and key-based unlock, and the defaults differ. The table summarises what each vendor's own documentation says.
| Silicon | Lock mechanism | Reversible? | Source |
|---|---|---|---|
| STM32 (classic series) | Readout protection (RDP) Level 0 open, Level 1 blocks flash access while a debugger is connected, Level 2 shuts debug off | Level 1 → 0 erases flash; for Level 2 the HAL warns "it s no more possible to go back to level 1 or 0" | ST HAL flash header; WOOT 2017 paper |
| STM32H5 | Product states from OPEN to CLOSED and LOCKED; "debug authentication" by "password or certificates", with certificates allowing "up to 3 levels of permissions" | In CLOSED, authenticated regression "erases the user flash memory and resets the product state to OPEN" | ST STM32CubeH5 debug authentication README |
| Nordic nRF52 / nRF53 / nRF54L | AP-Protect "blocks the debugger from read and write access to all CPU registers and memory-mapped addresses"; newer parts "ship with AP-Protect enabled" and it "re-enables on every hard reset" | ERASEALL via CTRL-AP erases flash, RAM and UICR; with UICR.ERASEPROTECT also set "the device cannot be unlocked or recovered" |
Nordic nRF Connect SDK AP-Protect documentation |
| ESP32-S3 | eFuse DIS_PAD_JTAG ("JTAG is disabled permanently"), DIS_USB_JTAG, or SOFT_DIS_JTAG |
Soft disable can be reopened with an HMAC key held in eFuse; not if the hard-disable bit is set | ESP-IDF eFuse and HMAC pages |
| Raspberry Pi RP2350 | OTP "debug disable" and "secure debug disable", or a "128-bit fixed debug key" in OTP | Key unlock until an OTP debug-disable flag removes access "even with key" | RP2350 datasheet §3.5.9 |
Two readings for product teams. First, "locked" means different things: STM32 Level 1 still leaves the debug interface active, while Level 2 and a set RP2350 disable flag remove it. Second, the default matters: older nRF52 build codes and most other parts ship open until firmware or the factory sets the lock.
Fuse, password or certificate: which lock should you use?
Use a permanent fuse when no one ever needs debug access to field units again, and certificate-based authenticated debug when RMA and failure analysis must stay possible. Espressif's ESP-IDF documentation shows the permanent pattern: "By default, enabling Flash Encryption and/or Secure Boot will disable JTAG debugging. On first boot, the bootloader will burn an eFuse bit to permanently disable JTAG at the same time it enables the other features." The same page shows the trade-off is explicit: a build-time option "will keep JTAG enabled at this time, removing all physical security but allowing debugging," so a manufacturer has to actively choose that weaker state.
Where a one-time fuse is not practical, CWE-1244's mitigation applies — for "security-sensitive assets accessible over debug/test interfaces, only allow trusted agents." The options, from weakest to strongest:
- Shared password or fixed key (STM32H5 password mode, RP2350 debug key). Simple, but one leaked value opens every unit that shares it; use per-device values derived from a secret you hold.
- Certificate-based authenticated debug. Arm's PSA Authenticated Debug Access Control, described in the TF-M ADAC integration guide as a protocol that uses "strong authentication to restrict device debug access to only authorized entities", "permits appropriate access to finely configured domains" through certificates instead of one shared secret.
- Erase-to-unlock (STM32 Level 1 → 0, nRF
ERASEALL, STM32H5 regression). Protects firmware and keys in flash, but gives anyone a way to reflash the unit with their own code.
Can a locked debug port still be bypassed?
Yes, with physical access and enough effort; a lock raises the cost, it does not end the threat. The USENIX WOOT 2017 paper on the STM32F0 found that "a common security configuration provides low protection" and used "Cold-boot Stepping" to "extract critical data or even readout-protected firmware" at RDP Level 1, concluding that "the practical protection offered by RDP Level 1 was shown to be futile under these conditions." It also showed a downgrade of the stored protection level using UV-C light.
Newer silicon is not immune. In the RP2350 hacking challenge results (14 January 2025), Raspberry Pi reported "four valid submissions, all of which require physical access to the chip"; in one, "the chip leaves reset with the RISC-V cores running and debugging allowed, regardless of the actual configuration written in the fuses", logged as erratum E16. Keep secrets that would compromise every unit (signing keys, shared cloud credentials) off the device, so one opened unit stays one opened unit.
What do ETSI EN 303 645 and the CRA expect?
Both expect debug interfaces to be disabled or access-controlled on shipped products. ETSI EN 303 645 V3.1.3 (2024-09) defines a debug interface with the examples "Test points, UART, SWD, JTAG" and sets provision 5.6-4A: "Debug interfaces shall be disabled or protected via a best practice authentication or access control mechanism", plus 5.6-4B, that physical debug ports "should be physically protected by the device." The EU Cyber Resilience Act, Annex I Part I (2), requires products to "limit attack surfaces, including external interfaces" (point j) and to ensure "protection from unauthorised access by appropriate control mechanisms" (point d). See ETSI EN 303 645 explained and CRA Annex I explained.
How do you keep factory test and RMA access without shipping an open port?
Decide per lifecycle stage who may debug and how, and set the lock as the last factory step after test, not as an afterthought. A typical plan:
| Stage | Debug state | Who can open it |
|---|---|---|
| Bring-up and development | Open (RDP 0, STM32H5 OPEN, nRF unlocked) | Any engineer on dev boards only |
| Factory programming and test | Open on the fixture, then locked as the final step | Test station; the lock result is read back and logged per serial number |
| Shipped unit | Fuse-locked, or authenticated debug only | Nobody, or holders of a per-device or certificate credential |
| RMA and failure analysis | Authenticated unlock or erase-to-unlock | PSIRT/quality team, with the unlock logged |
The step most often missed is the read-back: a fixture that "sends the lock command" without verifying the lock state can ship open units for weeks. A bootloader console such as U-Boot's needs the same lifecycle decision as the SWD pins.
Worked example: how would a sensor maker lock an STM32H5 across its lifecycle?
Synthetic example. The company and product are invented for illustration and are not a SoftWSP customer.
A maker of an industrial vibration sensor on an STM32H5 wants locked field units and the ability to analyse returns.
DevelopmentBoards stay in OPEN state; no production keys are ever loaded on them. ProvisioningOn the factory fixture, the device is provisioned with the debug-authentication certificate chain, then moved to CLOSED. VerificationThe fixture reads back the product state and fails any unit that is not CLOSED; the result goes into the per-serial test record. RMAThe quality team holds a certificate that allows regression only, so analysing a return erases user flash and the customer's data before any debug session starts. ReviewOnce a year, the team checks the vendor's errata and security notices for the part and re-tests one shipped unit with a debug probe.
What should a debug-port checklist include?
Identify which lock mechanism your silicon actually implements— a one-time eFuse/OTP bit, an erase-to-unlock state, or key- or certificate-based authenticated debug — rather than assuming "secure boot enabled" also means "debug port locked." They are frequently configured independently. Treat a lock as unproven until checked against the specific part's reference manual and errataCWE-1191's weakness is precisely a lock that exists but is not correctly enforced. Match the debug access level to what the asset actually needs, per CWE-1244 — a production unit rarely needs the same debug visibility into key storage that a bring-up unit does. Verify the lock on the fixtureand log it per serial number. Audit the physical board, not just the chip's datasheetCVE-2024-7726's drive enclosure and CVE-2025-59693's tamper label both show that a port can be nominally "protected" by an enclosure a temporarily-present attacker can still defeat. Pair a locked debug port with the controls it backs upA disabled JTAG/SWD interface closes one bypass path around secure boot and a hardware root of trust and around firmware OTA update signing; it does not replace either, and threat models like MITRE EMB3D catalog debug-interface abuse as one entry point among several.
What does SoftWSP check for debug-interface risk?
Nothing at the hardware level; debug-port state is a physical test. SoftWSP's firmware analysis extracts an SBOM (CycloneDX 1.6) from a submitted firmware image, matches the identified components against NVD, CISA KEV, FIRST EPSS and CISA CSAF ICS advisories, and drafts a cited report that an engineer reviews; the SBOM can be opened in the SBOM viewer. It does not parse the image for debug-enable flags or eFuse/lock-bit settings, does not connect a debug probe, and cannot confirm whether a chip's debug-lock fuse was blown on a given unit — that is done with a probe and the silicon vendor's tooling, as part of a manual review.
For the firmware SBOM such a review is recorded against, and for the broader testing methodology used to verify boot-chain and debug-access claims rather than take a vendor's datasheet at its word, see OWASP's firmware security testing methodology.
SoftWSP's Device & Firmware Security service reviews a device's debug and test interfaces — which lock mechanism is actually implemented, whether it is enforced correctly, and whether it matches the access level each on-chip asset needs — against the device's actual constraints: see Device & Firmware Security.
This guide draws on MITRE's published CWE definitions, NIST's published technical documents, NVD's public CVE records, silicon vendors' published documentation, a USENIX WOOT paper, ETSI EN 303 645 and the EU Cyber Resilience Act, cross-checked against each primary source directly on 13 November 2026. It is not a substitute for those documents' own text, or for an engineer's physical verification of a specific device's debug-port lock.
Put this guide to work
Frequently asked questions
What is the actual difference between JTAG and SWD?
Both reach the same internal debug access port and give a debugger the same practical power — halt the CPU, single-step it, and read or write memory and registers directly — but they are different physical wire protocols. JTAG (IEEE 1149.1) is the older, multi-pin boundary-scan standard that silicon vendors industry-wide repurposed as a transport for on-chip debug, typically needing four or five dedicated pins (TCK, TMS, TDI, TDO, and an optional TRST). SWD (Serial Wire Debug) is a two-pin alternative — SWCLK and SWDIO — that carries the equivalent debug traffic over far fewer package pins, which is why it shows up heavily on cost- and pin-constrained microcontrollers. MITRE's weakness catalog groups both under the same "On-Chip Debug and Test Interface" technology category (CWE-1191), because from a security standpoint the question is identical regardless of which wire protocol carries it: does the interface correctly check whether whoever is connected is actually authorized to be there.
Why does CWE-1191 and CWE-1244 classify an open debug port as a weakness, not just a convenience feature?
Because the debug port is not a side channel — it is the same privileged access a legitimate engineer uses to bring up and flash the device, exposed to whoever can physically reach the board. CWE-1191 ("On-Chip Debug and Test Interface With Improper Access Control") defines the weakness directly: "the chip does not implement or does not correctly perform access control to check whether users are authorized to access internal registers and test modes through the physical debug/test interface," with the consequence that "a user may be able to bypass on-chip protection mechanisms through the debug interface." CWE-1244 ("Internal Asset Exposed to Unsafe Debug Access Level or State") describes a narrower, related failure: a chip that does support multiple debug access levels but assigns the wrong one to a sensitive asset, so a secret or protected memory region ends up reachable "from untrusted debug agents" anyway. Both weaknesses point at the same underlying principle: a debug interface is only as safe as the access control gating it, and that gate has to actually be there and actually be correct.
Can a JTAG/SWD port be permanently disabled, or is a software 'lock' always reversible?
It depends entirely on whether the lock is a one-time, hardware-enforced fuse blow or a re-writable configuration bit — and real silicon ships both kinds. Espressif's ESP-IDF documentation describes the permanent form directly: "By default, enabling Flash Encryption and/or Secure Boot will disable JTAG debugging. On first boot, the bootloader will burn an eFuse bit to permanently disable JTAG at the same time it enables the other features," and that same documentation notes a build-time option exists that "will keep JTAG enabled at this time, removing all physical security but allowing debugging" — meaning the permanence is a genuine design choice a manufacturer has to make, not an automatic guarantee. A debug-disable implemented as an ordinary register bit instead of a blown fuse is exactly the gap CWE-1191 describes: if the chip does not correctly enforce that the bit can never be flipped back by an attacker with physical access, the lock is cosmetic. Confirming which kind of lock a specific part implements means reading that silicon vendor's own reference manual, not assuming either answer.
Does SoftWSP test a device's physical JTAG/SWD port directly?
No. SoftWSP's firmware analysis works from a firmware image, not a physical board: it extracts the software bill of materials, flags known-vulnerable components by matching them against CVE/KEV/EPSS data, and has AI narrate that evidence for an engineer to review — the same process used across the rest of a scan. It does not parse a firmware image's bootloader or configuration for debug-enable flags or eFuse/lock-bit settings; debug-interface risk in the CWE-1191/CWE-1244 categories this guide describes is assessed in a manual review. SoftWSP does not perform live hardware JTAG/SWD probing, does not physically connect a debugger to a device, and does not claim to verify at runtime whether a chip's debug-lock fuse was actually blown — that is a physical test an engineer performs with a debug probe and the vendor's own tooling, not something static firmware analysis can confirm on its own.
Sources
- MITRE CWE-1191: On-Chip Debug and Test Interface With Improper Access Control
- MITRE CWE-1244: Internal Asset Exposed to Unsafe Debug Access Level or State
- NIST Special Publication 800-193, Platform Firmware Resiliency Guidelines (May 2018, Final), Section 4.2.1.3 Non-Bypassability
- NVD: CVE-2024-48970 (Baxter Life2000 Ventilator, unauthenticated internal JTAG interface)
- NVD: CVE-2024-7726 (Kioxia CM6/PM6/PM7 SSDs, unauthenticated accessible JTAG port)
- NVD: CVE-2025-59693 (Entrust nShield HSM Chassis Management Board, JTAG access after tamper-label bypass)
- Espressif ESP-IDF Programming Guide: JTAG Debugging — Tips and Quirks (JTAG disable via eFuse under Secure Boot/Flash Encryption)
- STMicroelectronics STM32F4 HAL flash driver header (RDP level definitions; level 2 cannot be reverted)
- STMicroelectronics STM32CubeH5, Debug Authentication README (product state CLOSED, password or certificates, regression)
- Nordic Semiconductor nRF Connect SDK, AP-Protect documentation (ERASEALL, UICR.ERASEPROTECT, hardware/software AP-Protect)
- Espressif ESP-IDF, ESP32-S3 eFuse manager (DIS_PAD_JTAG, DIS_USB_JTAG, SOFT_DIS_JTAG)
- Espressif ESP-IDF, ESP32-S3 HMAC (re-enabling soft-disabled JTAG)
- Raspberry Pi RP2350 datasheet, section 3.5.9 (debug disable, secure debug disable, OTP debug keys)
- Raspberry Pi: RP2350 hacking challenge results (14 January 2025, erratum E16)
- Trusted Firmware-M, ADAC (Authenticated Debug Access Control) integration guide
- Obermaier and Tatschner, Shedding too much Light on a Microcontroller's Firmware Protection, USENIX WOOT 2017
- ETSI EN 303 645 V3.1.3 (2024-09), provisions 5.6-4A and 5.6-4B (debug interfaces)
- Regulation (EU) 2024/2847 (Cyber Resilience Act), Annex I Part I (2)(d) and (2)(j)
About this guide
SoftWSP Firmware Security Desk
Covers the Firmware vulnerabilities & fixes cluster: 135 guides.

In this cluster
Questions about this page?
