Skip to content

fix: send SSD password to BIOS for password protected drives during RPE - #2732

Draft
nmgaston wants to merge 4 commits into
mainfrom
rpeSSDPasswordFix
Draft

nmgaston wants to merge 4 commits into
mainfrom
rpeSSDPasswordFix

Conversation

@nmgaston

@nmgaston nmgaston commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

PR Checklist

  • Unit Tests have been added for new changes
  • API tests have been updated if applicable
  • All commented code has been removed
  • If you've added a dependency, you've ensured license is compatible with Apache 2.0 and clearly outlined the added dependency.

What are you changing?

1. Send SSD credentials to BIOS as UEFI TLVs instead of RSEPassword

Remote Platform Erase (RPE) of password-protected SSDs did not work, because MPS sent the SSD password in the RSEPassword field of AMT_BootSettingData. BIOS reads erase credentials from the UEFI boot parameters array, so it never got the password.

DeviceAction.sendRPE now appends the credentials to UefiBootParametersArray as extra Intel TLVs, after the existing erase-mask TLV:

TLV type Contents Source field
1 Erase mask (4 bytes, LE) existing
10 PSID (UTF-8) new psid request field
20 SSD master password (UTF-8) ssdPassword request field

Each TLV has the layout [vendor 0x8086 : u16 LE][type : u16 LE][length : u32 LE][value], and UefiBootNumberOfParams is set to match the number of TLVs.

  • Empty or missing credentials are left out.
  • Credentials are never sent for CSME-only requests, because no TLV array is built when there are no hardware erase bits.
  • RSEPassword is no longer sent.
  • The PUT body now uses the AMT.Models.BootSettingData type, and the old delete cleanup of conflicting and read-only fields is removed because the body is built explicitly.

2. New psid request field and credential validation

  • POST /api/v1/amt/boot/remoteErase/{guid} accepts an optional psid alongside ssdPassword.
  • Each credential must be a string of at most 64 UTF-8 bytes (MAX_SSD_PASSWORD_LENGTH). The limit is checked in two places:
    • in sendRPEValidator, which returns 400
    • in DeviceAction.sendRPE, before any WS-Man call, so device state isn't changed by a request that is going to fail

3. New endpoint: GET /api/v1/amt/boot/remoteErase/{guid}/status

The endpoint reads AMT_BootSettingData.BIOSLastStatus and returns { status, message }:

BIOSLastStatus status
[0, 0] succeeded
[1, *] pending
[2, *] (Not Updated) unknown
[0xFFFF, 1/2/3/other] failed (general / password-auth / unsupported / generic)
missing or unrecognized unknown

Notes for API consumers:

  • BIOSLastStatus is the result of the last BIOS boot. It has no operation ID, so callers should see pending after submitting an erase before trusting a succeeded or failed result.
  • succeeded means BIOS reported that the erase completed. It does not independently verify that the media was erased.
  • If the device can't be queried, the endpoint returns 500, never a success status.

4. Keeping credentials out of logs and errors

  • The ssdPassword/psid validators and the whole-body validator use .hide(), so credential values never show up in validation error responses.
  • The logger.silly(buffer.toString('utf8')) call is removed from HttpHandler.wrapIt. It logged entire outgoing WS-Man requests, credentials included.
  • The optional diagnostic XML log (MPS_RPE_LOG_REDACTED_XML) now redacts UefiBootParametersArray instead of RSEPassword.

5. Docs and tests

  • swagger.yaml:
    • documents psid, the byte limits, and the new status endpoint and RemoteEraseStatus schema
    • states that a successful RPE POST confirms submission, not completion
  • Unit tests cover:
    • TLV layout, including multi-byte UTF-8 boundary cases
    • rejecting oversized credentials before any device call
    • leaving credentials out of CSME-only requests
    • log redaction
    • validator errors not exposing credentials
    • status mapping and route registration
  • Postman and security API tests are added for the status endpoint and the credential limits.

Anything the reviewer should know when reviewing this PR?

  • Most of the line churn in DeviceAction.ts is re-indentation inside withDeviceLock. The real logic change is the TLV construction block.
  • Behavior change: RSEPassword is no longer sent. Any firmware that depended on it would now get the password only through the TLV.
  • The unit tests use mocked WS-Man responses. Hardware validation: TODO: platform / BIOS version / drive tested (locked SSD + PSID revert).
  • Reference: Intel AMT Secure Remote Platform Erase

If there are associated PRs in other repositories, please link them here

  • TODO: link Console / UI / wsman-messages PRs if any

@nmgaston
nmgaston marked this pull request as ready for review October 27, 2026 02:07
@nmgaston
nmgaston requested a balanced review from Copilot November 2, 2026 04:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Erase status can falsely report success, while SSD credentials can leak through validation responses and transport logs.

3 open issues
What changed in this PR

Updates MPS remote platform erase (RPE) to send SSD credentials to BIOS through UEFI parameters and adds an endpoint for querying the last BIOS erase status.

Changes:

  • Encodes SSD master passwords and optional PSIDs in UEFI TLVs, with 64-byte UTF-8 limits.
  • Adds a CIRA-protected BIOS status endpoint and related logging.
  • Expands unit tests, API test cases, and API documentation.
File Description
swagger.yaml Documents credentials and the BIOS status endpoint.
src/​test/​collections/​MPS.postman_collection.json Adds credential examples and a status request.
src/​test/​collections/​mps_security_api_test_postman_collection.json Updates the collection description.
src/​test/​collections/​data/​mps_security_api_test_data.json Adds status and credential-limit cases.
src/​routes/​amt/​sendRPEValidator.ts Validates both credential types and byte limits.
src/​routes/​amt/​sendRPEValidator.test.ts Covers credential types and UTF-8 boundaries.
src/​routes/​amt/​sendRPE.ts Forwards PSID alongside the SSD password.
src/​routes/​amt/​sendRPE.test.ts Verifies credential forwarding.
src/​routes/​amt/​index.ts Registers the CIRA-protected status route.
src/​routes/​amt/​getRemoteEraseStatus.ts Maps BIOS status values to API responses.
src/​routes/​amt/​getRemoteEraseStatus.test.ts Tests status mapping, failures, and route registration.
src/​logging/​messages.ts Adds BIOS status event messages.
src/​amt/​DeviceAction.ts Builds credential TLVs and redacts diagnostic XML.
src/​amt/​deviceAction.test.ts Tests TLV encoding, limits, omission, and redaction.

Review effort: Balanced

Comment thread src/routes/amt/getRemoteEraseStatus.ts Resolved
Comment thread src/amt/DeviceAction.ts Resolved
Comment thread src/routes/amt/sendRPEValidator.ts Resolved
@nmgaston
nmgaston marked this pull request as draft November 2, 2026 04:15
@nmgaston
nmgaston requested a balanced review from Copilot November 2, 2026 18:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Destructive credential encoding and BIOS status mappings need firmware or device validation because the tests use synthetic responses and do not establish end-to-end erase behavior.

1 open issue
2 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Destructive credential TLV framing and BIOS status decoding need validation against Intel’s specification or real hardware, since the tests use mocked responses.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The credential TLV encoding and BIOS status mapping need validation against supported hardware or an authoritative protocol fixture because mocked tests cannot establish interoperability for an irreversible erase operation.

No open issues 🎉

Review effort: Balanced

@nmgaston
nmgaston marked this pull request as ready for review November 2, 2026 20:49
@nmgaston
nmgaston marked this pull request as draft November 20, 2026 20:24

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants