Togoder security

npm package security report

@testing-library/react npm package: is it safe?

Risky patterns found that deserve a look.

Needs review Version 16.3.3 Files reviewed 13 Size 118.7 KB Scanned

Summary

Togoder Security scanned the npm package @testing-library/react@16.3.3 on Oct 6, 2026. An AI review of 13 source files produced 1 low severity finding. 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.

0
critical
0
high
0
medium
1
low

Findings 1

low

Global environment modification at import time

NPS-B64208EC50A6

The file sets process.env.RTL_SKIP_AUTO_CLEANUP = true at module load time. While not malicious per se, this mutates global process state and affects the runtime environment of any application that imports it, potentially suppressing automatic cleanup behavior in testing libraries. This is a side effect on import rather than a data exfiltration or code execution vector.

dont-cleanup-after-each.js:1

Files reviewed

FileVerdictWhat the reviewer saw
dont-cleanup-after-each.js medium No malicious patterns detected, but the module mutates a global environment variable at import time, which is a side-effect concern rather than a security threat.
dist/@testing-library/react.cjs.js safe No malicious patterns detected; this is the legitimate @testing-library/react library which performs React testing utilities without any data exfiltration, credential harvesting, obfuscation, or other suspicious behavior.
dist/@testing-library/react.esm.js safe No malicious patterns detected; the code is the legitimate @testing-library/react testing utility with only expected test-environment behavior.
dist/@testing-library/react.pure.cjs.js safe No malicious patterns detected; the code is the legitimate @testing-library/react library implementation.
dist/@testing-library/react.pure.esm.js safe No malicious patterns detected; the code is the legitimate @testing-library/react package implementing testing utilities with no data exfiltration, obfuscation, or suspicious behavior.
dist/@testing-library/react.pure.umd.js safe This is the legitimate @testing-library/react UMD bundle; no malicious patterns, network exfiltration, credential harvesting, or dynamic code execution were detected.
dist/@testing-library/react.umd.js safe No malicious patterns detected in this standard @testing-library/react UMD bundle.
dist/act-compat.js safe No malicious patterns detected; the code is a standard React act compatibility shim that only interacts with React internals and globalThis.
dist/config.js safe This is a standard @testing-library/react configuration module with no malicious patterns, network activity, filesystem access, or dynamic code execution.
dist/fire-event.js safe No malicious patterns detected
dist/index.js safe No malicious patterns detected; the code is a standard React Testing Library entry point that conditionally registers test cleanup hooks at import time.
dist/pure.js safe No malicious patterns detected; the code is a standard @testing-library/react distribution file with no security concerns.
pure.js safe Cleared by Jev triage; no further analysis needed

Scanned versions of @testing-library/react

VersionVerdictFilesScanned
16.3.3 Needs review 13 Oct 6, 2026

Frequently asked questions

Is @testing-library/react safe to use?

No confirmed malware was found in @testing-library/react@16.3.3, but the review flagged 1 low severity finding for risky patterns worth checking before you rely on it.

Does @testing-library/react contain malware?

No malware was identified in @testing-library/react@16.3.3 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 @testing-library/react checked?

Togoder Security downloaded the published npm package and had an AI model read its 13 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 @testing-library/react 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 @testing-library/react@16.3.3, cost nothing.

Related security reports