news.volyx.in

Shai-Hulud Themed Malware Found in the PyTorch Lightning AI Training Library (semgrep.dev)

465 points by j12y · 122 days ago · 177 comments on HN

Article summary

The PyTorch Lightning AI training library was compromised in versions 2.6.2 and 2.6.3 with malware that steals credentials and attempts to poison GitHub repositories. The malware is themed around Shai-Hulud and is believed to be the work of the same threat actor behind the mini Shai-Hulud campaign. The malicious code was not submitted to the main GitHub repository, but was instead published directly to PyPI using compromised credentials. Users are advised to use version 2.6.1 until a patched version is released.

Main themes

  • Supply chain attack
  • Malware in open-source libraries
  • GitHub repository security
  • Dependency management
  • PyTorch Lightning library
  • Shai-Hulud malware campaign

What commenters say

  • The malware's use of public GitHub repositories to exfiltrate stolen credentials is a clever way to bypass traditional security measures.
  • Pinning dependencies is not a foolproof way to prevent malware infections, as the code can still be compromised at the time of pinning.
  • Requiring two-factor authentication for publishing to package repositories like PyPI could help prevent similar attacks in the future.
  • The naming convention of the PyTorch Lightning library is not unusual, but it can cause confusion about its affiliation with the official PyTorch project.
  • Using a monorepo with a single lockfile and infrequent updates can help mitigate the risk of dependency-based attacks.
  • The decision to host compromised versions of the library in other mirrors or repositories is a concern, and users should be cautious when updating dependencies.
  • The community's quick response to reporting the security issue and providing temporary solutions is a positive aspect of open-source software development.
  • The idea of having no dependencies in software development is appealing, but may not be practical for large-scale projects.