sails
Audited by Socket on Sep 14, 2026
2 alerts found:
Securityx2The code is primarily legitimate upload documentation and shows no clear malicious behavior or intentional obfuscation. The main security issue is the unvalidated filename passed to path.resolve and res.sendFile, which can enable path traversal and unauthorized local file reads. Restrict the route to authorized users, use path.basename or an opaque server-generated identifier, and verify the resolved path remains inside the upload directory. Validate file signatures and safely handle stored metadata rather than trusting client-supplied MIME types and filenames.
The fragment does not show malware or deliberate supply-chain attack behavior. It contains a serious authentication weakness: automatic creation of an administrator with the known password 'changeme'. Production database TLS validation is also disabled, weakening transport security. The default credential must be removed or replaced with a securely provisioned, mandatory first-run credential, and rejectUnauthorized should be enabled with appropriate CA validation.