Skip to content

Commit 3e96fe6

Browse files
committed
Go/Java/JS/Python/Ruby: Update the description and qhelp of the ZipSlip query
All filesystem operations, not just writes, with paths built from untrusted archive entry names are dangerous
1 parent 4763812 commit 3e96fe6

File tree

12 files changed

+54
-55
lines changed

12 files changed

+54
-55
lines changed

csharp/ql/src/Security Features/CWE-022/ZipSlip.qhelp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
"qhelp.dtd">
44
<qhelp>
55
<overview>
6-
<p>Extracting files from a malicious zip archive without validating that the destination file path
7-
is within the destination directory can cause files outside the destination directory to be
8-
overwritten, due to the possible presence of directory traversal elements (<code>..</code>) in
6+
<p>Accessing filesystem paths built from the name of an archive entry without validating that the
7+
destination file path is within the destination directory can allow an attacker to access
8+
unexpected resources, due to the possible presence of directory traversal elements (<code>..</code>) in
99
archive paths.</p>
1010

1111
<p>Zip archives contain archive entries representing each file in the archive. These entries
1212
include a file path for the entry, but these file paths are not restricted and may contain
1313
unexpected special elements such as the directory traversal element (<code>..</code>). If these
14-
file paths are used to determine an output file to write the contents of the archive item to, then
15-
the file may be written to an unexpected location. This can result in sensitive information being
14+
file paths are used to create a filesystem path, then a file operation may happen in an
15+
unexpected location. This can result in sensitive information being
1616
revealed or deleted, or an attacker being able to influence behavior by modifying unexpected
1717
files.</p>
1818

csharp/ql/src/Security Features/CWE-022/ZipSlip.ql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
2-
* @name Arbitrary file write during zip extraction ("Zip Slip")
3-
* @description Extracting files from a malicious zip archive without validating that the
4-
* destination file path is within the destination directory can cause files outside
5-
* the destination directory to be overwritten.
2+
* @name Arbitrary file access during archive extraction ("Zip Slip")
3+
* @description Accessing filesystem paths built from the name of an archive entry without
4+
* validating that the destination file path is within the destination directory
5+
* can allow an attacker to access unexpected resources.
66
* @kind path-problem
77
* @id cs/zipslip
88
* @problem.severity error

go/ql/src/Security/CWE-022/ZipSlip.qhelp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55

66
<overview>
77
<p>
8-
Extracting files from a malicious zip archive without validating that the destination file path
9-
is within the destination directory can cause files outside the destination directory to be
10-
overwritten, due to the possible presence of directory traversal elements (<code>..</code>) in
8+
Accessing filesystem paths built from the name of an archive entry without validating that the
9+
destination file path is within the destination directory can allow an attacker to access
10+
unexpected resources, due to the possible presence of directory traversal elements (<code>..</code>) in
1111
archive paths.
1212
</p>
1313

1414
<p>
1515
Zip archives contain archive entries representing each file in the archive. These entries
1616
include a file path for the entry, but these file paths are not restricted and may contain
1717
unexpected special elements such as the directory traversal element (<code>..</code>). If these
18-
file paths are used to determine which output file the contents of an archive item should be written to, then
19-
the file may be written to an unexpected location. This can result in sensitive information being
18+
file paths are used to create a filesystem path, then a file operation may happen in an
19+
unexpected location. This can result in sensitive information being
2020
revealed or deleted, or an attacker being able to influence behavior by modifying unexpected
2121
files.
2222
</p>

go/ql/src/Security/CWE-022/ZipSlip.ql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
2-
* @name Arbitrary file write during zip extraction ("zip slip")
3-
* @description Extracting files from a malicious zip archive without validating that the
4-
* destination file path is within the destination directory can cause files outside
5-
* the destination directory to be overwritten.
2+
* @name Arbitrary file access during archive extraction ("Zip Slip")
3+
* @description Accessing filesystem paths built from the name of an archive entry without
4+
* validating that the destination file path is within the destination directory
5+
* can allow an attacker to access unexpected resources.
66
* @kind path-problem
77
* @id go/zipslip
88
* @problem.severity error

java/ql/src/Security/CWE/CWE-022/ZipSlip.qhelp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@
33
"qhelp.dtd">
44
<qhelp>
55
<overview>
6-
<p>Extracting files from a malicious zip archive (or another archive format)
7-
without validating that the destination file path
8-
is within the destination directory can cause files outside the destination directory to be
9-
overwritten, due to the possible presence of directory traversal elements (<code>..</code>) in
6+
<p>Accessing filesystem paths built from the name of an archive entry without validating that the
7+
destination file path is within the destination directory can allow an attacker to access
8+
unexpected resources, due to the possible presence of directory traversal elements (<code>..</code>) in
109
archive paths.</p>
1110

1211
<p>Zip archives contain archive entries representing each file in the archive. These entries
1312
include a file path for the entry, but these file paths are not restricted and may contain
1413
unexpected special elements such as the directory traversal element (<code>..</code>). If these
15-
file paths are used to determine an output file to write the contents of the archive item to, then
16-
the file may be written to an unexpected location. This can result in sensitive information being
14+
file paths are used to create a filesystem path, then a file operation may happen in an
15+
unexpected location. This can result in sensitive information being
1716
revealed or deleted, or an attacker being able to influence behavior by modifying unexpected
1817
files.</p>
1918

java/ql/src/Security/CWE/CWE-022/ZipSlip.ql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
2-
* @name Arbitrary file write during archive extraction ("Zip Slip")
3-
* @description Extracting files from a malicious archive without validating that the
4-
* destination file path is within the destination directory can cause files outside
5-
* the destination directory to be overwritten.
2+
* @name Arbitrary file access during archive extraction ("Zip Slip")
3+
* @description Accessing filesystem paths built from the name of an archive entry without
4+
* validating that the destination file path is within the destination directory
5+
* can allow an attacker to access unexpected resources.
66
* @kind path-problem
77
* @id java/zipslip
88
* @problem.severity error

javascript/ql/src/Security/CWE-022/ZipSlip.qhelp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
<qhelp>
55

66
<overview>
7-
<p>Extracting files from a malicious zip archive without validating that the destination file path
8-
is within the destination directory can cause files outside the destination directory to be
9-
overwritten, due to the possible presence of directory traversal elements (<code>..</code>) in
7+
<p>Accessing filesystem paths built from the name of an archive entry without validating that the
8+
destination file path is within the destination directory can allow an attacker to access
9+
unexpected resources, due to the possible presence of directory traversal elements (<code>..</code>) in
1010
archive paths.</p>
1111

1212
<p>Zip archives contain archive entries representing each file in the archive. These entries
1313
include a file path for the entry, but these file paths are not restricted and may contain
1414
unexpected special elements such as the directory traversal element (<code>..</code>). If these
15-
file paths are used to determine an output file to write the contents of the archive item to, then
16-
the file may be written to an unexpected location. This can result in sensitive information being
15+
file paths are used to create a filesystem path, then a file operation may happen in an
16+
unexpected location. This can result in sensitive information being
1717
revealed or deleted, or an attacker being able to influence behavior by modifying unexpected
1818
files.</p>
1919

javascript/ql/src/Security/CWE-022/ZipSlip.ql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
2-
* @name Arbitrary file write during zip extraction ("Zip Slip")
3-
* @description Extracting files from a malicious zip archive without validating that the
4-
* destination file path is within the destination directory can cause files outside
5-
* the destination directory to be overwritten.
2+
* @name Arbitrary file access during archive extraction ("Zip Slip")
3+
* @description Accessing filesystem paths built from the name of an archive entry without
4+
* validating that the destination file path is within the destination directory
5+
* can allow an attacker to access unexpected resources.
66
* @kind path-problem
77
* @id js/zipslip
88
* @problem.severity error

python/ql/src/experimental/Security/CWE-022/ZipSlip.qhelp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
<qhelp>
55

66
<overview>
7-
<p>Extracting files from a malicious zip archive without validating that the destination file path
8-
is within the destination directory can cause files outside the destination directory to be
9-
overwritten, due to the possible presence of directory traversal elements (<code>..</code>) in
7+
<p>Accessing filesystem paths built from the name of an archive entry without validating that the
8+
destination file path is within the destination directory can allow an attacker to access
9+
unexpected resources, due to the possible presence of directory traversal elements (<code>..</code>) in
1010
archive paths.</p>
1111

1212
<p>Zip archives contain archive entries representing each file in the archive. These entries
1313
include a file path for the entry, but these file paths are not restricted and may contain
1414
unexpected special elements such as the directory traversal element (<code>..</code>). If these
15-
file paths are used to determine an output file to write the contents of the archive item to, then
16-
the file may be written to an unexpected location. This can result in sensitive information being
15+
file paths are used to create a filesystem path, then a file operation may happen in an
16+
unexpected location. This can result in sensitive information being
1717
revealed or deleted, or an attacker being able to influence behavior by modifying unexpected
1818
files.</p>
1919

python/ql/src/experimental/Security/CWE-022/ZipSlip.ql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
2-
* @name Arbitrary file write during archive extraction ("Zip Slip")
3-
* @description Extracting files from a malicious archive without validating that the
4-
* destination file path is within the destination directory can cause files outside
5-
* the destination directory to be overwritten.
2+
* @name Arbitrary file access during archive extraction ("Zip Slip")
3+
* @description Accessing filesystem paths built from the name of an archive entry without
4+
* validating that the destination file path is within the destination directory
5+
* can allow an attacker to access unexpected resources.
66
* @kind path-problem
77
* @id py/zipslip
88
* @problem.severity error

0 commit comments

Comments
 (0)