Skip to content
vetkitChecksChangelogDocumentation

vetkit.csharp.path-traversal.zip-slip

An archive entry's FullName is used to build an extraction path without checking that the result stays inside the target directory (zip slip). A crafted archive can overwrite arbitrary files.

Last updated:

Suite: Security

csharp

An archive entry's FullName is used to build an extraction path without checking that the result stays inside the target directory (zip slip). A crafted archive can overwrite arbitrary files.

Category: SECURITY · Engine rule severity: WARNING

How to fix it

Resolve Path.GetFullPath(Path.Combine(dest, entry.FullName)) and skip the entry unless it starts with the full destination path plus a separator, or use ZipFile.ExtractToDirectory, which performs this check.

References

Source: packages/engine/rules/sast/csharp.yml.

Generated from shipped rule definitions at build time. Matching is a review signal, not proof of exploitability. “generic” denotes text matching, not complete language or framework coverage. Runtime configuration and available tools affect whether a rule runs.