Skip to content

Conversation

subhankarmaiti
Copy link
Contributor

Background

A recent npm phishing campaign led to the compromise of several prettier tooling packages. The attack involved:

  • Phishing emails targeting package maintainers using typosquatted domain (npnjs.com)
  • Stolen npm tokens used to publish malicious versions
  • Compromised packages included Windows-specific payloads attempting to load DLLs

Affected malicious versions:

  • eslint-config-prettier: 8.10.1, 9.1.1, 10.1.6, 10.1.7
  • eslint-plugin-prettier: 4.2.2, 4.2.3

Changes

Our versions were already safe, but this PR adds extra protection by pinning exact versions:

  • prettier: ^3.0.33.0.3 (was never compromised)
  • eslint-config-prettier: ^10.1.110.1.5 (pinned to last known safe version)
  • eslint-plugin-prettier: ^5.5.15.5.1 (already safe, now pinned)
  • prettier-plugin-organize-imports: ^4.1.04.1.0 (pinned for consistency)

Security Impact

  • No immediate threat: Our current versions were not affected by the malicious releases
  • Future protection: Pinned versions prevent accidental installation of any compromised packages
  • Best practice: Follows security recommendation to avoid floating version ranges in CI pipelines

References

Verification

  • All pinned versions are confirmed safe
  • No breaking changes introduced
  • Existing functionality preserved

@subhankarmaiti subhankarmaiti changed the title chore: pin prettier-related packages to prevent npm phishing attack chore: pin prettier-related packages to prevent malicious package installation Jul 21, 2025
@subhankarmaiti subhankarmaiti marked this pull request as ready for review July 21, 2025 09:38
@subhankarmaiti subhankarmaiti requested a review from a team as a code owner July 21, 2025 09:38
@subhankarmaiti subhankarmaiti merged commit 6887b5b into master Jul 21, 2025
4 checks passed
@subhankarmaiti subhankarmaiti deleted the pin-prettier-packages branch July 21, 2025 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants