Skip to content

ISSUE-4106: Fix NFC read stuck on Mifare Ultralight when signature read fails (fi…#4353

Draft
herbenderbler wants to merge 2 commits intoflipperdevices:devfrom
herbenderbler:ISSUE-4106/fix-nfc-mifare-ultralight-card
Draft

ISSUE-4106: Fix NFC read stuck on Mifare Ultralight when signature read fails (fi…#4353
herbenderbler wants to merge 2 commits intoflipperdevices:devfrom
herbenderbler:ISSUE-4106/fix-nfc-mifare-ultralight-card

Conversation

@herbenderbler
Copy link

@herbenderbler herbenderbler commented Mar 12, 2026

What's new

This fixes the NFC read getting stuck on Don't Move for some ISO 14443-3A Mifare Ultralight / NTAG213 cards when the Read Signature step fails (e.g. FWT timeouts).

Why?

On affected cards, version detection succeeds and the tag is identified as NTAG213, but the signature read repeatedly fails. The poller then transitioned to ReadFailed, so the whole read was aborted and the device kept retrying indefinitely.

Changes

  • lib/nfc/protocols/mf_ultralight/mf_ultralight_poller.c: In mf_ultralight_poller_handler_read_signature, when the card supports Read Signature, but the read returns an error, it continues the read instead of going to ReadFailed:
    • Log "Read signature failed, continuing without signature"
    • Zero data->signature so no stale data is stored
    • Set next state to Auth (or AuthMfulC for MfulC) so page read and the rest of the flow runs as normal
  • Signature remains optional: dumps without signature (zeros) are valid and save/load unchanged.
  • Small refactor:
    • In mf_ultralight_poller_handler_read_signature, the choice between Auth and AuthMfulC is now made in a single place using a signature_read_ok flag, removing the duplicated feature-check logic from the “signature failed” and “skip signature” branches.
  • This closes ISSUE NFC Reading Issue with ISO 14443-3A Mifare Ultralight Card #4106.

Verification

  • Read an ISO 14443-3A Mifare Ultralight / NTAG213 card that previously got stuck; read should complete and show success, with signature zeroed if that step failed.
  • Cards that already read signature successfully should behave unchanged.
  • I'm also ordering ISO 14443-3A Mifare Ultralight and NTAG213 cards in order to test this end-to-end on my FZ. Once end-to-end tests are successful, I'll switch this Draft PR into a review ready status.

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

…flipperdevices#4106)

Treat Read Signature as optional: if the card supports it but the command
fails (e.g. FWT timeout), continue to Auth/ReadPages instead of aborting
the read. Zero the signature buffer on failure. Unify Auth/AuthMfulC
choice in read_signature handler.

Made-with: Cursor
@herbenderbler herbenderbler force-pushed the ISSUE-4106/fix-nfc-mifare-ultralight-card branch from beef4d2 to 5c9b8ac Compare March 12, 2026 18:26
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.

1 participant