Files
DeepTutor/deeptutor/services/notebook
Wood 603f234ac1 fix(notebook): prevent path traversal via read/write path asymmetry
_get_notebook_file() previously joined the request-controlled notebook_id
onto the notebook base directory without validating the resolved path, and
_save_notebook() wrote using the file-content id field instead of the
caller's validated id. Together these allowed an arbitrary .json overwrite
(e.g. data/system/auth/users.json) leading to privilege escalation.

- _get_notebook_file(): resolve the target and reject any path that escapes
  base_dir (Path.is_relative_to), raising ValueError.
- _save_notebook(): accept the validated notebook_id explicitly instead of
  trusting notebook['id']; all call sites updated to pass it.
2026-09-16 11:10:53 +08:00
..