__proto__ added prototypes

This commit is contained in:
Sebastian Hildebrandt 2025-01-02 09:06:40 +01:00
parent 52194beb6b
commit 48517047c0
7 changed files with 29 additions and 1 deletions

View File

@ -90,6 +90,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
| Version | Date | Comment |
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
| 5.24.4 | 2025-01-02 | `__proto__` added prototypes |
| 5.24.3 | 2025-01-01 | `__proto__` deno compatibility |
| 5.24.2 | 2025-01-01 | `versions()` fixed node version |
| 5.24.1 | 2024-12-31 | `versions()` fixed deno and bun |

View File

@ -57,6 +57,11 @@
</tr>
</thead>
<tbody>
<tr>
<th scope="row">5.24.4</th>
<td>2025-01-02</td>
<td><span class="code">prototype pollution()</span> added prototypes</td>
</tr>
<tr>
<th scope="row">5.24.3</th>
<td>2025-01-01</td>

View File

@ -170,7 +170,7 @@
<img class="logo" src="assets/logo.png" alt="logo">
<div class="title">systeminformation</div>
<div class="subtitle"><span id="typed"></span>&nbsp;</div>
3<div class="version">New Version: <span id="version">5.24.2</span></div>
3<div class="version">New Version: <span id="version">5.24.4</span></div>
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
</div>
<div class="down">

View File

@ -456,7 +456,11 @@ function dockerContainerStats(containerIDs, callback) {
try {
containerIDsSanitized.__proto__.toLowerCase = util.stringToLower;
containerIDsSanitized.__proto__.replace = util.stringReplace;
containerIDsSanitized.__proto__.toString = util.stringToString;
containerIDsSanitized.__proto__.substr = util.stringSubstr;
containerIDsSanitized.__proto__.substring = util.stringSubstring;
containerIDsSanitized.__proto__.trim = util.stringTrim;
containerIDsSanitized.__proto__.startsWith = util.stringStartWith;
} catch (e) {
Object.setPrototypeOf(containerIDsSanitized, util.stringObj);
}

View File

@ -1177,7 +1177,11 @@ function networkStats(ifaces, callback) {
try {
ifaces.__proto__.toLowerCase = util.stringToLower;
ifaces.__proto__.replace = util.stringReplace;
ifaces.__proto__.toString = util.stringToString;
ifaces.__proto__.substr = util.stringSubstr;
ifaces.__proto__.substring = util.stringSubstring;
ifaces.__proto__.trim = util.stringTrim;
ifaces.__proto__.startsWith = util.stringStartWith;
} catch (e) {
Object.setPrototypeOf(ifaces, util.stringObj);
}

View File

@ -129,7 +129,11 @@ function services(srv, callback) {
try {
srvString.__proto__.toLowerCase = util.stringToLower;
srvString.__proto__.replace = util.stringReplace;
srvString.__proto__.toString = util.stringToString;
srvString.__proto__.substr = util.stringSubstr;
srvString.__proto__.substring = util.stringSubstring;
srvString.__proto__.trim = util.stringTrim;
srvString.__proto__.startsWith = util.stringStartWith;
} catch (e) {
Object.setPrototypeOf(srvString, util.stringObj);
}
@ -989,7 +993,12 @@ function processLoad(proc, callback) {
try {
processesString.__proto__.toLowerCase = util.stringToLower;
processesString.__proto__.replace = util.stringReplace;
processesString.__proto__.toString = util.stringToString;
processesString.__proto__.substr = util.stringSubstr;
processesString.__proto__.substring = util.stringSubstring;
processesString.__proto__.trim = util.stringTrim;
processesString.__proto__.startsWith = util.stringStartWith;
} catch (e) {
Object.setPrototypeOf(processesString, util.stringObj);
}

View File

@ -89,6 +89,7 @@ const stringReplace = new String().replace;
const stringToLower = new String().toLowerCase;
const stringToString = new String().toString;
const stringSubstr = new String().substr;
const stringSubstring = new String().substring;
const stringTrim = new String().trim;
const stringStartWith = new String().startsWith;
const mathMin = Math.min;
@ -764,6 +765,9 @@ function isPrototypePolluted() {
st.__proto__.toLowerCase = stringToLower;
st.__proto__.toString = stringToString;
st.__proto__.substr = stringSubstr;
st.__proto__.substring = stringSubstring;
st.__proto__.trim = stringTrim;
st.__proto__.startsWith = stringStartWith;
} catch (e) {
Object.setPrototypeOf(st, stringObj);
}
@ -2578,6 +2582,7 @@ exports.stringReplace = stringReplace;
exports.stringToLower = stringToLower;
exports.stringToString = stringToString;
exports.stringSubstr = stringSubstr;
exports.stringSubstring = stringSubstring;
exports.stringTrim = stringTrim;
exports.stringStartWith = stringStartWith;
exports.mathMin = mathMin;