How ectfmitre/2026-ectf-insecure-example works
This is an insecure example design for an eCTF hardware security module (HSM). A host sends control commands to the firmware, which dispatches file operations, applies PIN/permission checks, and reads or writes persistent flash; a neighboring HSM can exchange files over a separate UART interface. The repository also includes shared-secret generation and firmware-header conversion, plus an optional crypto example. Edges reflect shown calls or README statements; unsampled implementation details are not inferred.
Main entry points: HSM.c Boot and dispatcher · commands.c Command handlers · filesystem.c File operations · host_messaging.c Packet messaging
Components 14
HSM firmware
- Boot and dispatcher
firmware/src/HSM.c - Command handlers
firmware/src/commands.c - PIN and permissions
firmware/src/security.c
Persistent storage
- File operations
firmware/src/filesystem.c - Flash access
firmware/src/simple_flash.c
Device interfaces
- Packet messaging
firmware/src/host_messaging.c - UART transport
firmware/src/simple_uart.c - MSP configuration
firmware/src/ti_msp_dl_config.c - Device startup
firmware/src/startup_mspm0l222x_ticlang.c
Secrets and crypto
- Shared-secret generator
ectf26_design/src/gen_secrets.py - Secret header converter
firmware/secrets_to_c_header.py - Crypto example
firmware/src/simple_crypto.c
Other components
- Host
- Neighbor HSM
Connections 14
- Host → Boot and dispatcher: sends commands
firmware/src/HSM.c - Boot and dispatcher → Packet messaging: reads packets
firmware/src/HSM.c - Boot and dispatcher → Command handlers: dispatches commands
firmware/src/HSM.c - Boot and dispatcher → File operations: initializes filesystem
firmware/src/HSM.c - Boot and dispatcher → MSP configuration: initializes hardware
firmware/src/HSM.c - Command handlers → PIN and permissions: checks access
firmware/src/commands.c - Command handlers → File operations: reads and writes files
firmware/src/commands.c - Command handlers → Packet messaging: sends packets
firmware/src/commands.c - Command handlers → Neighbor HSM: exchanges file messages
firmware/src/commands.c - File operations → Flash access: reads and writes
firmware/src/filesystem.c - Packet messaging → UART transport: transfers bytes
firmware/src/host_messaging.c - UART transport → MSP configuration: uses peripheral config
firmware/src/simple_uart.c - Boot and dispatcher → Crypto example: runs optional example
firmware/src/HSM.c - Boot and dispatcher → Device startup: uses startup support