Company
Date Published
Author
Liran Tal
Word count
1350
Language
English
Hacker News points
1

Summary

Typosquatting attacks involve malicious actors pushing fake packages with similar names to popular ones in public software registries, such as npm or PyPI, with the goal of tricking users into installing them. These attacks are common and can be difficult to countermeasure against due to their low barrier of entry. A notable example is the crossenv package, which was published on npm with a similar name to a popular package, but actually captured environment variables and sent them to an attacker-controlled remote server. The malicious package used the `postinstall` script to collect environment variables and send them to the server. To protect against such attacks, it's recommended to not store sensitive information in environment variables, use tools like Snyk to monitor dependencies, consult the Snyk Advisor before installing packages, and consider using flags or tools that ignore scripts from third-party packages during installation.