Summary
Togoder Security scanned the npm package string.prototype.trimend@1.0.9 on Oct 6, 2026. An AI review of 5 source files produced 3 medium severity findings. The overall verdict is medium: the findings flag risky but common patterns (dynamic code, unsafe defaults, broad file or network access) rather than confirmed malware.
Findings 3
Indirect code execution via module import
NPS-1C0D71860994
The file immediately invokes the exported function from './shim' at top-level (require-time). Since './shim' is not shown, this shim module can execute arbitrary code upon loading, including installing hooks, monkey-patching globals, harvesting environment variables/credentials, or performing network requests. Top-level execution on import is a common vector for malicious npm packages.
Potential global environment modification
NPS-37C593EB4632
The term 'shim' typically implies modifying global objects or built-ins (e.g. patching process, console, require, or other prototypes). Such behavior can silently alter runtime semantics for the entire application, enabling interception of sensitive data or stealthy execution.
Opaque dependency
NPS-E314D708CA3C
The actual behavior cannot be verified from this file alone — all logic resides in './shim'. The entry point provides no indication of what the shim does, which is a common obfuscation/encapsulation pattern in malicious packages.
Files reviewed
| File | Verdict | What the reviewer saw |
|---|---|---|
| auto.js | medium | The file is a thin wrapper that immediately executes an unspecified shim module at require-time, which is a potential vector for hidden malicious behavior such as credential harvesting, monkey-patching, or code execution, though no direct malicious code is visible. |
| implementation.js | safe | The code implements a simple trimEnd polyfill using a whitespace regex and call-bound; no malicious patterns such as exfiltration, dynamic execution, or install-time hooks were detected. |
| index.js | safe | No malicious patterns detected |
| polyfill.js | safe | No malicious patterns detected; the code is a standard polyfill for String.prototype.trimEnd/trimRight with no network, filesystem, process, or dynamic execution activity. |
| shim.js | safe | No malicious patterns detected; the code is a standard polyfill shim for String.prototype.trimEnd using define-properties. |
Scanned versions of string.prototype.trimend
| Version | Verdict | Files | Scanned |
|---|---|---|---|
| 1.0.9 | Needs review | 5 | Oct 6, 2026 |
Frequently asked questions
Is string.prototype.trimend safe to use?
No confirmed malware was found in string.prototype.trimend@1.0.9, but the review flagged 3 medium severity findings for risky patterns worth checking before you rely on it.
Does string.prototype.trimend contain malware?
No malware was identified in string.prototype.trimend@1.0.9 when Togoder Security scanned it on Oct 6, 2026. A new version can still introduce malicious code, so scan the exact versions in your lockfile.
How was string.prototype.trimend checked?
Togoder Security downloaded the published npm package and had an AI model read its 5 source files, looking for install scripts, credential access, network exfiltration, obfuscation, backdoors and crypto-wallet theft. The results are cached by file hash and shown here.
How do I scan string.prototype.trimend together with the rest of my dependencies?
Upload your lockfile at https://security.togoder.click/scan or call the API documented at https://security.togoder.click/api-docs. Files that have already been scanned, like the ones in string.prototype.trimend@1.0.9, cost nothing.