Skip to content

Conversation

MDrakos
Copy link
Member

@MDrakos MDrakos commented Sep 4, 2025

No description provided.

return File{}, fmt.Errorf("archive not opened")
}

header, err := tgz.reader.Next()

Check failure

Code scanning / CodeQL

Arbitrary file access during archive extraction ("Zip Slip") High

Unsanitized archive entry, which may contain '..', is used in a
file system operation
.
Unsanitized archive entry, which may contain '..', is used in a
file system operation
.
Unsanitized archive entry, which may contain '..', is used in a
file system operation
.
Unsanitized archive entry, which may contain '..', is used in a
file system operation
.
Unsanitized archive entry, which may contain '..', is used in a
file system operation
.
Unsanitized archive entry, which may contain '..', is used in a
file system operation
.
Unsanitized archive entry, which may contain '..', is used in a
file system operation
.
Unsanitized archive entry, which may contain '..', is used in a
file system operation
.
@MDrakos MDrakos force-pushed the miked/archives-patch branch from 2f298ec to 4c9b50e Compare September 4, 2025 19:05
@MDrakos MDrakos force-pushed the miked/archives-patch branch from 4c9b50e to 562cdc5 Compare September 4, 2025 20:01
func (f File) getHeaderName() (string, error) {
var rawName string
if header, ok := f.Header.(*tar.Header); ok {
rawName = header.Name

Check failure

Code scanning / CodeQL

Arbitrary file write extracting an archive containing symbolic links High

Unresolved path from an archive header, which may point outside the archive root, is used in
symlink creation
.
if header, ok := f.Header.(*tar.Header); ok {
rawName = header.Name
} else if header, ok := f.Header.(zip.FileHeader); ok {
rawName = header.Name

Check failure

Code scanning / CodeQL

Arbitrary file write extracting an archive containing symbolic links High

Unresolved path from an archive header, which may point outside the archive root, is used in
symlink creation
.
}

// Access file object - path validation happens immediately after
file := z.reader.File[z.currentFile]

Check failure

Code scanning / CodeQL

Arbitrary file access during archive extraction ("Zip Slip") High

Unsanitized archive entry, which may contain '..', is used in a
file system operation
.
Unsanitized archive entry, which may contain '..', is used in a
file system operation
.
Unsanitized archive entry, which may contain '..', is used in a
file system operation
.
Unsanitized archive entry, which may contain '..', is used in a
file system operation
.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant