Skip to content

fix(security): stop an API key from sending every future transcript to a folder it picks - #533

Merged
GeiserX merged 7 commits into
mainfrom
fix/export-dir-access-rule
Nov 12, 2026
Merged

GeiserX merged 7 commits into
mainfrom
fix/export-dir-access-rule

Conversation

@GeiserX

@GeiserX GeiserX commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Problem

export.dir decides where every finished call goes: the Markdown, the event log and, with export.audio: copy, the audio. An admin API key could set it with PATCH /v1/config, also from another machine through the network listener. It could point it at a share it controls, such as \\host\share on Windows or /net/<host> on macOS. Every later call then went there, even after the key was revoked. On Windows each write also sends the user's NTLM hash to that host. The to of POST /calls/{id}/export had the same gap for one call. webhook.url is already file only for this reason.

Fix

Only the user on this computer can now choose these folders. That means the app's own token on the desktop app's loopback listener, so akou config set export.dir and akou export --to DIR work as before. It also means the desktop window. Some callers now get 400: an ak_ key, the window's page in a browser, and any caller in server mode. A key can still export a call into the folder the user set. The rule is a new keyWritable: false flag in the settings schema, next to apiWritable and windowWritable. The API reference, the configuration page, DESIGN and TRAPS (EXP-1, EXP-2) say this.

Testing

tests/export-access.test.ts runs each refused caller through the real routes. Against main's code, 6 of its 10 tests fail. With the fix, all 10 pass. The positive controls are:

  • the CLI path (the app token on loopback) and the desktop window still set export.dir and to
  • the same key still writes asr.threads
  • a key's export with no to still goes into export.dir

check:static, the settings-doc check and 13 related test files (193 tests, including the e2e suites that call PATCH /config and --to with the app token) pass.

… key's

export.dir and the export's `to` decide where every finished call's transcript and audio are written, yet an admin key could set them over the API, from another machine, and point them at a share it controls. Both are now taken only from the user on this computer: the app's own token on the desktop app's loopback listener (akou config set, akou export --to) and the desktop window. An ak_ key, the window's page in a browser and server mode get 400.
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 47 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between af3819c and 3cb2b63.

Files selected for processing: 9

  • docs/DESIGN.md
  • docs/TRAPS.md
  • docs/api/openapi.json
  • docs/configuration.md
  • src/main/api/caller.ts
  • src/main/api/routes/handoff.ts
  • src/main/api/routes/settings.ts
  • src/main/config/schema.ts
  • tests/export-access.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@GeiserX
GeiserX merged commit a9b0d3e into main Nov 12, 2026
30 checks passed
@GeiserX
GeiserX deleted the fix/export-dir-access-rule branch November 12, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant