Merge pull request #15607 from geoffw0/unsafeunpack

Swift: Trivial changes to swift/unsafe-unpacking
This commit is contained in:
Geoffrey White
2024-02-13 20:49:57 +00:00
committed by GitHub
9 changed files with 5 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
---
category: newQuery
---
* Added a new query, `swift/unsafe-unpacking`, that detects unpacking user controlled zips without validating the destination file path is within the destination directory.
* Added a new experimental query, `swift/unsafe-unpacking`, that detects unpacking user controlled zips without validating the destination file path is within the destination directory.

View File

@@ -27,7 +27,7 @@ The following examples unpacks a remote zip using `Zip.unzipFile()` which is vul
<p>
The following examples unpacks a remote zip using `fileManager.unzipItem()` which is vulnerable to symlink path traversal.
</p>
<sample src="ZIPFoundationBad.swift" />
<sample src="ZipFoundationBad.swift" />
<p>Consider using a safer module, such as: <code>ZIPArchive</code></p>

View File

@@ -1,7 +1,7 @@
edges
| UnsafeUnpack.swift:62:9:62:48 | call to Data.init(contentsOf:options:) | UnsafeUnpack.swift:62:60:62:60 | source |
| UnsafeUnpack.swift:62:60:62:60 | source | UnsafeUnpack.swift:64:27:64:27 | source |
| UnsafeUnpack.swift:62:60:62:60 | source | UnsafeUnpack.swift:67:39:67:39 | source |
| UnsafeUnpack.swift:62:9:62:48 | call to Data.init(contentsOf:options:) | UnsafeUnpack.swift:62:60:62:60 | source | provenance | |
| UnsafeUnpack.swift:62:60:62:60 | source | UnsafeUnpack.swift:64:27:64:27 | source | provenance | |
| UnsafeUnpack.swift:62:60:62:60 | source | UnsafeUnpack.swift:67:39:67:39 | source | provenance | |
nodes
| UnsafeUnpack.swift:62:9:62:48 | call to Data.init(contentsOf:options:) | semmle.label | call to Data.init(contentsOf:options:) |
| UnsafeUnpack.swift:62:60:62:60 | source | semmle.label | source |