nextjs-best-practices

Warn

Audited by Socket on Jul 25, 2026

3 alerts found:

AnomalySecurityx2
AnomalyLOW
dataset/data/unstable-cache/incorrect.tsx

No clear evidence of intentional malware is visible in this fragment (no obvious backdoor/credential theft/execution primitives). The primary security risks are logic and trust-boundary issues: caching via unstable_cache appears to use static keys that do not incorporate dynamic arguments (symbol/userId/order-related inputs), which can cause cross-request/cross-user data mixups; getUserDashboard directly trusts the x-user-id header for user selection; and processOrder wraps a state change plus an email side effect in a cache, which can undermine expected side-effect semantics. The snippet is incomplete, and key helper implementations (sendConfirmationEmail, heavyCalculation, the client component) are missing, so confidence is moderate and malware cannot be ruled out entirely.

Confidence: 46%Severity: 56%
SecurityMEDIUM
dataset/security/auth-actions/incorrect.tsx

No clear evidence of traditional malware (e.g., C2, shell, or external exfiltration), but the code shows multiple severe application security issues. The biggest concerns are: (1) a direct leakage of passwordHash via getAllUsers(); (2) missing visible authorization checks for multiple destructive/admin server actions (delete/update posts, ban/grant admin, update other users’ email/profile); and (3) unusual module-scope fetch calls that attempt to trigger internal action endpoints with hardcoded action identifiers, which could enable automated privileged action triggering if endpoint protections are weak. Overall, this fragment warrants urgent access-control review and removal/containment of action-forging fetch logic.

Confidence: 66%Severity: 86%
SecurityMEDIUM
dataset/security/env-boundary/incorrect.tsx

This module demonstrates severe insecure secret handling: secrets and API keys appear both as hardcoded values and as environment-derived values used in client-side code, then transmitted via fetch (including in a URL query string and to an external domain via X-API-Key). It also discloses sensitive configuration (DATABASE_URL) in the UI and logs fetched responses to the browser console. Even without proving intentional malware, the code strongly indicates credential leakage/exfiltration risk and should not be used as-is; all secrets must be moved to server-side endpoints and rotated if any key exposure occurred.

Confidence: 78%Severity: 98%
Audit Metadata
Analyzed At
Jul 25, 2026, 06:04 AM
Package URL
pkg:socket/skills-sh/xirothedev%2Fskills%2Fnextjs-best-practices%2F@8e715442c26bf5788dd14f762a41dff0a164af9d7ad751bcca0dc4e1d5a8849e
Security Audit — socket — nextjs-best-practices