mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
Add ElectronShellOpenExternalSink class
Add ElectronShellOpenExternalSink class to detect untrusted input interpreted by `openExternal` function call in `electron` module. Based on the #14 Electron Security checklist: https://www.electronjs.org/docs/tutorial/security#14-do-not-use-openexternal-with-untrusted-content
This commit is contained in:
@@ -138,4 +138,15 @@ module CodeInjection {
|
||||
API::moduleImport("module").getInstance().getMember("_compile").getACall().getArgument(0)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Improper use of openExternal can be leveraged to compromise the user's host.
|
||||
* When openExternal is used with untrusted content, it can be leveraged to execute arbitrary commands.
|
||||
*/
|
||||
class ElectronShellOpenExternalSink extends Sink {
|
||||
ElectronShellOpenExternalSink() {
|
||||
this =
|
||||
DataFlow::moduleMember("electron", "shell").getAMemberCall("openExternal").getArgument(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user