Repository navigation
fix(settings): protect mobile pairing codes - #1113
Conversation
Deny scalar reads of mobile_pairing_code via /api/settings/:key and fully mask non-empty values as **** in bulk /api/settings responses while keeping /api/mobile/pairing-code working for callers with mobile-access.manage. Fixes #1071
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
|
@greptile review |
|
Fixes #1071
Intent
Implement the surgical fix for FreeOpenSourcePOS/FloCafe issue #1071 ("mobile_pairing_code exposed in settings"): deny scalar reads of
mobile_pairing_codevia/api/settings/:keyand fully maskmobile_pairing_code(****when non-empty,''when empty) in bulk/api/settingsresponses, while keeping the dedicated/api/mobile-access/pairingroute working for authorized callers (mobile-access.manage). Deliver via theno-mistakespipeline as its own PR (Fixes #1071).What Changed
mobile_pairing_codetoSENSITIVE_SETTING_KEYSinmain/routes/settings.tsso scalar reads viaGET /api/settings/mobile_pairing_codeare denied with HTTP 403.maskSettinginmain/routes/settings.tsto fully mask non-emptymobile_pairing_codevalues as****(and preserve''when empty) in bulkGET /api/settingsresponses without exposing trailing characters.tests/security-hardening.test.tsto verify scalar denial and bulk masking ofmobile_pairing_codeacross roles while confirmingGET /api/mobile/pairing-codecontinues to work for callers withmobile-access.manage.Risk Assessment
✅ Low: The change is a minimal, surgical two-line update in main/routes/settings.ts with comprehensive behavioral regression tests in tests/security-hardening.test.ts that satisfies all acceptance criteria without side effects.
Testing
The Test agent exceeded its invocation budget before live validation completed; no evidence was gathered for this head.
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.