Skip to content

Use safeloader to load checkpoint meta files - #3067

Open
pplantinga wants to merge 1 commit into
speechbrain:developfrom
pplantinga:fix-ckpt-yaml-load
Open

Use safeloader to load checkpoint meta files#3067
pplantinga wants to merge 1 commit into
speechbrain:developfrom
pplantinga:fix-ckpt-yaml-load

Conversation

@pplantinga

Copy link
Copy Markdown
Collaborator

While loading checkpoints is known to be unsafe (see issue #1930), a related potential security issue is loading checkpoint meta files (usually CKPT.yaml) which is currently also unsafe, and has the potential to be slightly more surprising as all meta files in the save directory can be loaded for sorting etc., not just the target checkpoint. This adjusts the behavior so that meta files are loaded with SafeLoader, reducing the chance that a malicious meta file could be loaded without knowing.

Adopting this PR would mean that the old supported behavior of storing objects (e.g. Tensors) in the meta would be no longer supported, so we should run recipe tests and make sure no recipes depend on this. Also, this would merit a warning in the release notes and potentially a minor version marker rather than patch (i.e. 1.2 rather than 1.1.1).

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.

1 participant