Skip to content

fix(desktop): reject profile ids that escape the profiles folder - #23

Merged
arifintahu merged 1 commit into
mainfrom
fix/profile-id-validation
Oct 28, 2026
Merged

arifintahu merged 1 commit into
mainfrom
fix/profile-id-validation

Conversation

@arifintahu

Copy link
Copy Markdown
Member

What and why

profile_upsert and profile_delete built profiles/<id>.toml from an unchecked id, so ../ ids could write or delete .toml files elsewhere. Ids are now limited to [A-Za-z0-9_-]{1,64} in save_profile and delete_profile. Generated (8 hex) and built-in ids still pass.

Fixes #19

How you checked it

  • Added tests first: traversal, separator, drive and extension ids are rejected; generated and built-in ids are accepted; save/delete refuse ../evil.
  • cargo fmt --check, cargo clippy --all-targets -- -D warnings, cargo test pass.

@arifintahu arifintahu self-assigned this Oct 28, 2026
@arifintahu
arifintahu merged commit fee22bd into main Oct 28, 2026
@arifintahu
arifintahu deleted the fix/profile-id-validation branch October 28, 2026 12:42
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.

fix(desktop): profile id is used unsanitized in a file path

1 participant