• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cameri / nostream / 46992911997
78%
main: 81%

Build:
Build:
LAST BUILD BRANCH: rewrite/main
DEFAULT BRANCH: main
Ran 02 Dec 2026 11:19PM UTC
Jobs 2
Files 322
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

02 Dec 2026 11:15PM UTC coverage: 77.86% (+0.005%) from 77.855%
46992911997

push

github

web-flow
fix(admin): refuse a write at a path above a protected value (#1353)

The settings write path checked the paths a request *named* and let
through a write at a path that *holds* `admin.passwordHash`. Replacing
`admin` replaced the hash, so a settings write could take over the
console. Closes #1352.

## Measured before

On `cb22d716`:

```
PATCH /admin/settings {"path": "admin", "value": {"passwordHash": "scrypt$probe"}}
-> 200 {"ok":true,"path":"admin","value":{"passwordHash":"***"}}
settings.yaml: scrypt:BwcHBwcH…  ->  scrypt$probe
```

The echo redacts the value, so the answer looks correct while the write
lands. MCP `settings_set` calls the same `patch_settings::apply`, so a
token holding only the `write` scope reached it too.

## Why

`patch_settings.rs:108` refused only a change whose path *is*
write-protected. `validate.rs:578` deliberately allows `passwordHash` as
a key under `admin`, so the value validated, and `set_by_path` then
replaced the subtree.

`main` guards this by comparing documents rather than paths:
`patch-settings-controller.ts:92-100` calls
`changedWriteProtectedSettingsPaths(protectedBefore, nextUserSettings)`
and refuses when any protected value moved, with a comment naming this
exact case.

## Change

- `collect_write_protected_settings` and
`changed_write_protected_settings_paths` in `nostream-config`, ported
from `settings-redaction.ts:56-86`: every protected path in a document,
and the ones whose value differs between two documents, added or removed
ones included.
- `patch_settings::apply` collects the protected values of the stored
user document and of the document as it would be saved, after the
changes are applied and before anything is written, and refuses with
`Path is write-protected` on any difference.

## Testing

| Case | Result |
|---|---|
| `cargo test -p nostream-config --test redaction` | 14 passed (2 new) |
| `cargo test -p nostream-admin --test write_path` | 6 passed (1 new) |
| Without the guard (the control... (continued)

4635 of 6495 branches covered (71.36%)

Branch coverage included in aggregate %.

10012 of 12317 relevant lines covered (81.29%)

752.5 hits per line

Jobs
ID Job ID Ran Files Coverage
1 Integration - 46992911997.1 02 Dec 2026 11:19PM UTC 322
32.46
GitHub Action Run
2 Unit - 46992911997.2 02 Dec 2026 11:19PM UTC 322
75.36
GitHub Action Run
Source Files on build 46992911997
  • Tree
  • List 322
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #46992911997
  • 77e882ac on github
  • Prev Build on rewrite/main (#46969238346)
  • Next Build on rewrite/main (#47009814710)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc