mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[GH-ISSUE #360] credentials.json is world-readable #238
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#238
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sigvei on GitHub (Aug 7, 2019).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/360
Librespot caches credentials in
$cache/credentials.json. On my system (Arch Linux; using Librespot through spotifyd) the file seems to be created world- and group-readable (644).The file stores an authentication token, not the password, so I guess this is not a very serious security issue. It should probably at least be mentioned in the docs that the cache dir should be kept secure (700). As it stands, users might (sensibly!) assign /tmp as a cache dir, which would expose the token to all users on the system.
@cip123 commented on GitHub (Mar 22, 2020):
I would like to start working on this one but I am completely new to Rust so I would like to ask somebody opinion on the implementation.
I took a quick look at the code and the main problem that I see is the portability between Windows and Unix.
i.e I could do something like this in
authentication.rsbut the tricky part would be to conditionally compile
std::os::unix::fs::OpenOptionsEx.My first thought is to separate the logic into different files with a trait or an interface and then load that specific file conditionally with
#[cfg(target_os = "<unix|windows>")]@sashahilton00 commented on GitHub (Jan 31, 2021):
Added a note in the
README.md