mirror of
https://github.com/github/codeql.git
synced 2026-05-03 04:39:29 +02:00
Merge pull request #9754 from erik-krogh/chownr
JS: add model for chownr
This commit is contained in:
4
javascript/ql/lib/change-notes/2022-06-30-chownr.md
Normal file
4
javascript/ql/lib/change-notes/2022-06-30-chownr.md
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
category: minorAnalysis
|
||||
---
|
||||
* The `chownr` library is now modeled as a sink for the `js/path-injection` query.
|
||||
@@ -192,6 +192,18 @@ private class WriteFileAtomic extends FileSystemWriteAccess, DataFlow::CallNode
|
||||
override DataFlow::Node getADataNode() { result = this.getArgument(1) }
|
||||
}
|
||||
|
||||
/**
|
||||
* A call to the library `chownr`.
|
||||
* The library changes the owner of a file or directory recursively.
|
||||
*/
|
||||
private class Chownr extends FileSystemWriteAccess, DataFlow::CallNode {
|
||||
Chownr() { this = DataFlow::moduleImport("chownr").getACall() }
|
||||
|
||||
override DataFlow::Node getAPathArgument() { result = this.getArgument(0) }
|
||||
|
||||
override DataFlow::Node getADataNode() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* A call to the library `recursive-readdir`.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user