Repository navigation
SimplrSSH - Bug Hunter - 2026-10-16 - #22
Merged
Merged
Conversation
An <option> left open before a <select> that adds no field (disabled, or past MAX_FIELDS) was finished later with select_field == -1, indexing page.fields[-1]. Close the open option when a new select starts. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015W3Ue1tJJP4yetdkD4wmX1
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
1. Out-of-bounds
page.fields[-1]in the sign-in page parser (main/portal.cpp,Parser::start_tag,selectbranch; reached fromfinish_option())<select>did not close an open<option>. If the new select added no field (disabled, or pastMAX_FIELDS),select_fieldbecame -1 whilein_optionstayed true. The next</select>,<option>or the end of the page then ranfinish_option(), which indexedpage.fields[-1]. If the new select did add a field, the old option was filed under the wrong select.portal: memory corruption, or a crash and reboot. It cannot be reached when the user does not runportal.finish_option()when a<select>starts.Read with no defect found:
vterm.cpp,ui_page.cpp,command_redact.cpp,tab5_keymap.cpp, and the URL, entity and tokenizer parts ofportal.cpp.Plan
main/portal.cpp). Verify with a regression test under ASAN.Gap analysis (final)
portal.cppportal_unclosed_option_before_a_skipped_selectDeferred
decode_entitiesaccepts&# 65;and&#+65;becausestrtoulskips whitespace and signs. Browsers do not decode these.38:2::r:g:bwith an empty colour-space field, are treated as plain parameters and give a wrong colour.ssh_terminal.cpp,chat_app.cpp,openai_client.cpp,known_hosts.cpp,settings_backup.cpp.Verification
integration, before the change:SKIP_SAST=1 scripts/check.shpassed (93 guard tests, host unit tests). I installedlibmbedtls-devfirst because the host build needs it.SKIP_SAST=1 scripts/check.shpassed (guards OK, host unit tests 100% passed).scripts/sast.sh), because docker/ECR is not available here. CI's security scan still runs it. The firmware build was not run either, since ESP-IDF is not installed. This change touches only host-testable parser code.🤖 Generated with Claude Code
https://claude.ai/code/session_015W3Ue1tJJP4yetdkD4wmX1
Generated by Claude Code