Bump espex to 0.9 and nerves_github_updater to 0.2 - #166
Merged
Conversation
nerves_github_updater 0.2.0 refuses installing the version already running, closing a replay vector: the busy guard rejects only concurrent installs, so anything able to reach install_latest/1 could previously loop a device indefinitely at the same version. No app change needed — :allow_reinstall defaults to false, which is the behaviour we want, and both install entry points already gate on there being a newer version. espex 0.9.0 adds the optional EntityProvider.handle_command/2 carrying the connection's security context. Nothing uses it yet on main; the constraint moves to ~> 0.9 so that when the privileged-command gate lands it cannot silently resolve against 0.8.0, where a provider exporting /2 compiles fine and is simply never called. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Merged
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.
Picks up the two library-side security fixes from the
/phx:reviewof #161.nerves_github_updaterespexhandle_command/2security contextLock diff is exactly those two packages; nothing else moved.
nerves_github_updater 0.2.0 — takes effect immediately
The version gate only guarded
:lt, so:eqfell through and re-downloaded, re-flashed and rebooted into identical firmware. That was a replay vector:handle_call(:install_latest, ...)rejects only concurrent installs, so once one finished nothing stopped the next — anything able to reachinstall_latest/1could loop a device indefinitely, at the same version, with real flash wear.No app change needed.
:allow_reinstalldefaults tofalse, which is the posture we want, and I checked both install entry points already gate on there being a newer version — the web UI onupdate_available?/2, HA's update card onlatest_version != current_version— so neither UI regresses.grepconfirms nothing inlib/,test/orconfig/relies on reinstall.espex 0.9.0 — groundwork, inert on this branch
0.9.0 adds the optional
EntityProvider.handle_command/2carrying%{encrypted?: boolean()}. Nothing onmainimplements it, so espex keeps calling/1exactly as before — this bump changes no behaviour today.The constraint moves to
~> 0.9rather than staying~> 0.8for a specific reason:~> 0.8admits 0.8.0, and a provider that implements/2compiles fine against 0.8.0 and is never called, because 0.8.0's handler only invokes/1. Since that callback is the gate refusing firmware-install and factory-reset on unauthenticated connections, resolving to 0.8.0 would leave the security check silently inert with nothing failing to indicate it. Pinning~> 0.9makes that unrepresentable.Verification
mix compile --warnings-as-errors— PASSmise run test— 953 passed, 3 excluded (matches main's baseline)mix dialyzer— PASS (7 errors, 7 skipped, 0 unnecessary skips)mix format --check-formatted— cleanMIX_TARGET=rpi3 mix compile— PASSFollow-up
#162 (the privileged-command gate, B2) is a draft pinned to an espex branch. Once this merges it should be rebased onto it and its git pin dropped — the
~> 0.9constraint here is what it needs. Happy to do that rebase on request.🤖 Generated with Claude Code