chain-studio/lib/data
flemming-it 1c306916aa
Some checks failed
Security / Security check (push) Failing after 1s
fix(security): atomic hub-auth-token writes (P1-5)
`hub_auth_token.dart` write() previously did

  await f.writeAsString(token);          // file is now 0644 (umask)
  await Process.run('chmod', ['600', f.path]);

which leaves a TOCTOU window where the file is world-readable
between the writeAsString and the chmod call. On a multi-user
host another user could read the bearer token during that
window.

New flow:

  await tmp.writeAsString(token);        // .tmp file
  await chmod(600, tmp.path);            // restrict mode FIRST
  await tmp.rename(f.path);              // atomic POSIX rename

The destination is never visible with permissive perms. Also
sets `~/.fai/` itself to 0700 on Unix on first creation so
other users on a shared host can't enumerate the directory.

dart analyze clean; flutter test green (12 tests).
Bumped pubspec to 0.49.1.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
2026-05-29 17:47:29 +02:00
..
flow_output.dart chore(studio): switch to fai_client_sdk (renamed from fai_dart_sdk) 2026-05-26 13:46:32 +02:00
format.dart feat(studio): typed flow outputs + on-disk docs + UX polish 2026-05-25 11:17:58 +02:00
friendly_error.dart chore(studio): switch to fai_client_sdk (renamed from fai_dart_sdk) 2026-05-26 13:46:32 +02:00
hub.dart feat(settings): multi-version uninstall picker + default_scope editor 2026-05-29 00:21:51 +02:00
hub_auth_token.dart fix(security): atomic hub-auth-token writes (P1-5) 2026-05-29 17:47:29 +02:00
registry_token.dart feat(studio): registry credentials panel in Settings (v0.44.0) 2026-05-09 13:38:47 +02:00
system_actions.dart feat(studio): hub maintenance panel with reset action (v0.45.0) 2026-05-09 18:52:19 +02:00
theme_plugin.dart feat(studio): surface provider + sourceKind + versionAdvisory on CapabilityInfo 2026-05-28 10:54:48 +02:00
today_story_loader.dart feat(studio): daily Today-Hero proposal pipeline (v0.31.0) 2026-05-08 12:59:33 +02:00