mirror of
https://codeberg.org/guix/guix.git
synced 2026-09-04 12:51:45 +00:00
Previously the cache key would be computed by prepending “channels/” to the channel name. Thus, a channel defined like this: (channel (name (symbol->string "../../../../PWND")) …) … would lead to the creation of a file in $HOME. This attack is accessible even with channel files evaluated in a sandbox, and even if the channel is otherwise marked as trusted. This change fixes that. * guix/git-authenticate.scm (repository-cache-key): Deprecate. (authenticate-repository): Change default value of #:cache-key. (authenticated-commit-cache-file): Replace dots in KEY with dashes. * guix/scripts/git/authenticate.scm (guix-git-authenticate): Use ‘commit’ as the default value of ‘cache-key’. * guix/channels.scm (maybe-link-old-cache): New procedure. (authenticate-channel): Remove ‘cache-key’ and #:cache-key argument to ‘authenticate-repository’. Call ‘maybe-link-old-cache’. Reported-by: Sergio Pastor Pérez <sergio.pastor-perez@inria.fr> Signed-off-by: Ludovic Courtès <ludo@gnu.org>