Togoder security

npm package security report

cookie-signature@1.0.7 security report

Risky patterns found that deserve a look.

Needs review Version 1.0.7 Files reviewed 1 Size 1.3 KB Scanned

Summary

Togoder Security scanned the npm package cookie-signature@1.0.7 on Oct 4, 2026. An AI review of 1 source file produced 1 medium 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
1
medium
0
low

Findings 1

medium

Weak cryptographic comparison

NPS-5715150A44C5

The unsign function validates the signature using a non-constant-time comparison (sha1(mac) == sha1(val)). This is vulnerable to timing attacks, allowing an attacker to incrementally guess the correct signature. It also unnecessarily hashes the HMAC before comparison, which, while harmless here, is a non-standard pattern that weakens the security intent relative to a direct constant-time comparison.

index.js:47

Files reviewed

FileVerdictWhat the reviewer saw
index.js medium The file implements cookie signing/unsigning logic without malicious patterns, but uses a non-constant-time signature comparison that is vulnerable to timing attacks.

Affected version ranges

None of the 3 scanned versions of cookie-signature are flagged high or critical. The latest scanned version, 1.2.2, is clean. Only versions we have scanned are listed; unscanned versions between them are not covered.

1.0.61.2.2
VersionsVerdictCountRangeTop findings
1.2.2 No issues 1 1.2.2
1.0.7 Needs review 1 1.0.7 Weak cryptographic comparison
1.0.6 No issues 1 1.0.6

Full list, including published versions not scanned yet: version ranges API.

Scanned versions of cookie-signature

VersionVerdictFilesScanned
1.2.2 No issues 1 Oct 4, 2026
1.0.7 Needs review 1 Oct 4, 2026
1.0.6 No issues 1 Oct 4, 2026

Frequently asked questions

Is cookie-signature safe to use?

No confirmed malware was found in cookie-signature@1.0.7, but the review flagged 1 medium severity finding for risky patterns worth checking before you rely on it.

Does cookie-signature contain malware?

No malware was identified in cookie-signature@1.0.7 when Togoder Security scanned it on Oct 4, 2026. A new version can still introduce malicious code, so scan the exact versions in your lockfile.

How was cookie-signature checked?

Togoder Security downloaded the published npm package and had an AI model read its 1 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 cookie-signature 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 cookie-signature@1.0.7, cost nothing.

Related security reports