# arraybuffer.prototype.slice@1.0.4 security report (npm)

- Verdict: **Needs review** (risk level: medium)
- Scanned: 2026-10-06T14:13:48.000Z
- Files reviewed: 5
- Findings: 4 medium, 1 low severity findings
- Report: https://security.togoder.click/npm/arraybuffer.prototype.slice
- Source: Togoder Security (https://security.togoder.click), AI source-code review

## Summary

Togoder Security scanned the npm package arraybuffer.prototype.slice@1.0.4 on Oct 6, 2026. An AI review of 5 source files produced 4 medium, 1 low 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

### [medium] Indirect code execution via module import

Finding ID: `NPS-F07160B415F7`

File: `auto.js:3`

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.

### [medium] Potential global environment modification

Finding ID: `NPS-646715108640`

File: `auto.js:3`

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.

### [medium] Opaque dependency

Finding ID: `NPS-380BB550A534`

File: `auto.js:3`

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.

### [medium] Correctness bug / potential out-of-bounds access

Finding ID: `NPS-D3D8638F236E`

File: `implementation.js:62`

The copy loop iterates from `start` to `end`, but `start` and `end` may be undefined, non-integer, negative, or exceed the buffer length. Additionally, the source index `i` is used directly against the original `start`/`end` arguments rather than the bounds-adjusted `first`/`final`/`newLen`. This can lead to incorrect copying, out-of-range reads/writes on the TypedArray views (silently ignored for reads, but may throw for writes in some engines), or invalid memory access semantics. While not directly malicious, this indicates the code does not correctly implement the intended ArrayBuffer.prototype.slice behavior and may cause unexpected runtime behavior.

### [low] Dynamic module loading / computed require

Finding ID: `NPS-C3650910156E`

File: `implementation.js:3`

The file uses `require('get-intrinsic')` to dynamically obtain the global %ArrayBuffer% and %Uint8Array% intrinsic constructors. While get-intrinsic is a legitimate package, its use here means the actual constructors are resolved at runtime from the environment. If an attacker can tamper with the global object or the module resolution chain (e.g., via prototype pollution), they could substitute malicious constructors. This is a low-severity concern in context but worth noting as a dynamic resolution mechanism.

## Files reviewed

- `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` (medium): The code appears to be a legitimate polyfill/implementation for ArrayBuffer.prototype.slice with a correctness bug in the copy loop, but no clear malicious patterns such as data exfiltration, credential harvesting, obfuscation, or process execution were detected.
- `index.js` (safe): No malicious patterns detected; the file is a standard polyfill export module using define-properties and call-bind with only local requires.
- `polyfill.js` (safe): No malicious patterns detected
- `shim.js` (safe): No malicious patterns detected

AI analysis is guidance, not a guarantee. Methodology: https://security.togoder.click/methodology
