| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: c8b95804-edaa-4c22-a191-3cb4467055c4 You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file. Use the checkbox below for a quick retry:
WalkthroughThis PR adds a BLE preference write validation mechanism: a new preference-write-guard.ts module enforces a key whitelist and write-enabled checks, PreferenceServer gains enableWrites/disableWrites with an opt-in write-window timer, setup-mode wires it in, and tests plus tsconfig aliases and a UARTServer fake support the new behavior. ChangesBLE Preference Write Guard
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant SetupMode
participant PreferenceServer
participant WriteGuard as validatePreferenceWrite
participant Preference
SetupMode->>PreferenceServer: enableWrites(durationMs)
PreferenceServer->>PreferenceServer: start write-window timer, set writesEnabled=true
Note over PreferenceServer: BLE client sends domain.key/value
PreferenceServer->>WriteGuard: validatePreferenceWrite(allowedKeys, writesEnabled, domain, key)
WriteGuard-->>PreferenceServer: decision (allowed or rejection reason)
alt allowed
PreferenceServer->>Preference: set(domain.key, value)
PreferenceServer-->>SetupMode: onPreferenceChanged
else rejected
PreferenceServer->>PreferenceServer: trace(rejection reason)
end
PreferenceServer->>PreferenceServer: write-window timer fires, disableWrites()
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. ❤️ ShareComment @coderabbitai help to get the list of available commands. |
Sorry, something went wrong.
|
✅ Action performed
Review finished.
|
Sorry, something went wrong.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)firmware/host/app/setup-mode.ts (1)60-76: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Time-box the BLE write window
🤖 Prompt for AI Agents
firmware/host/app/setup-mode.ts:76 — pass a durationMs to preferenceServer.enableWrites(). The whitelist limits what can change, but the opt-in write window should still expire automatically instead of staying open for the full setup session.Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@firmware/host/app/setup-mode.ts` around lines 60 - 76, The BLE write window is left open indefinitely because PreferenceServer.enableWrites() is called without an expiry; update setup-mode.ts to pass a durationMs when enabling writes so the opt-in window closes automatically after a short period. Use the existing PreferenceServer instance in setup-mode.ts and adjust the enableWrites() call to include an appropriate time limit while keeping the current whitelist behavior intact.
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. Outside diff comments: In `@firmware/host/app/setup-mode.ts`: - Around line 60-76: The BLE write window is left open indefinitely because PreferenceServer.enableWrites() is called without an expiry; update setup-mode.ts to pass a durationMs when enabling writes so the opt-in window closes automatically after a short period. Use the existing PreferenceServer instance in setup-mode.ts and adjust the enableWrites() call to include an appropriate time limit while keeping the current whitelist behavior intact.
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 56099d6d-b46f-4dd1-b20b-038c4da05ab2
📥 CommitsReviewing files that changed from the base of the PR and between 092e56a and 7dd47f8.
📒 Files selected for processing (6)
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
概要
BLE preference server が任意の Preference 書き込みを受け付けないよう、書き込み window と whitelist を追加します。
変更内容
検証
未実施
リリース影響
patch。脆弱な書き込み経路を制限する修正のため、リリースノート記載が必要です。
Closes #505
関連 #399
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes