Repository navigation
SimplrSSH - Bug Hunter - 2026-10-18 - #28
Merged
Merged
Conversation
A 10-digit 'u' record passed the digit-count check but exceeds UINT32_MAX; strtoul then clamped or truncated it before nvs_set_u32. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KhZ1xbmvwNKARGdpyRmryh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Findings
main/settings_backup.cpp:304-308(parse_settings, typeu). Root cause: the check allowed any ≤10-digit decimal string, but 10 digits can exceedUINT32_MAX;strtoulthen clamped (32-bit) or truncated (64-bit) the value beforenvs_set_u32. Impact: Low/Medium. A corrupt or tampered SD backup is accepted as valid, with a silently altered setting, where the rule is that the whole backup is validated before anything changes.Reviewed with no defect found:
vterm.cpp,tab5_keymap.cpp,command_redact.cpp,ui_page.cpp,known_hosts.cpp, and the URL/entity parsing inportal.cpp.Plan
Reject
urecords aboveUINT32_MAXinparse_settings. Add a regression case torestore_rejects_untrusted_backups. Verify with the host tests.Final gap analysis
Deferred (not fixed here)
ssh/sshkeycommands split on single spaces, so a double space shifts the arguments and gives port 0. Port range validation inssh_beginis already onorigin/code-scan/20261018-0000(b411112), so I left it to avoid a conflict.connect "SSID" ""(open network) fails with a usage message, because an empty quoted password is dropped. Needs a product decision.hosts forgetprints "Forgot ..." even ifnvs_erase_keyfails (known_hosts.cpp). Not host-testable.atoiwith no range check. Covered by the connect-time check above.Verification
scripts/check.shwithSKIP_SAST=1: guard tests passed (97 OK). Host unit and persistence tests pass:unit_tests114/114,persistence_tests24/24.idf.py sizenot run (no ESP-IDF here). The change is host-only, parser logic with no RAM impact. Hardware behavior is unconfirmed on a real T-Deck or Tab5.Generated by Claude Code