Skip to content

chore: pin eslint-config-prettier and eslint-plugin-prettier versions to prevent malicious package installation#1137

Merged
tusharpandey13 merged 2 commits into
masterfrom
security/fix-prettier-phishing
Jul 21, 2025
Merged

chore: pin eslint-config-prettier and eslint-plugin-prettier versions to prevent malicious package installation#1137
tusharpandey13 merged 2 commits into
masterfrom
security/fix-prettier-phishing

Conversation

@tusharpandey13
Copy link
Copy Markdown
Contributor

@tusharpandey13 tusharpandey13 commented Jul 20, 2025

Pin eslint-config-prettier and eslint-plugin-prettier to exact versions to protect against the recent npm phishing attack that compromised these packages. The caret range ^8.8.0 could have installed malicious versions.

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

🔍 RCA

A phishing campaign compromised npm maintainer credentials, leading to malicious versions of eslint-config-prettier (10.1.6, 10.1.7) and eslint-plugin-prettier (4.2.2, 4.2.3) being published. Our semver range ^10.0.1 was vulnerable to installing the malicious 10.1.6 and 10.1.7 versions.

📋 Changes

Pin exact versions of potentially vulnerable packages to prevent automatic installation of compromised versions through semver ranges.

  • Changed package.json: pinned eslint-config-prettier from ^8.8.0 to 8.8.0 and eslint-plugin-prettier from ^4.2.1 to 4.2.1
  • Changed package-lock.json: removed version ranges.

📎 References

https://socket.dev/blog/npm-phishing-campaign-leads-to-prettier-tooling-packages-compromise

🎯 Testing

Automated:
No new tests required - this is a dependency version change with no functional impact.

Manual:

  1. Run pnpm install to verify no version conflicts
  2. Run pnpm run lint to confirm ESLint configuration still works
  3. Verify the pinned versions match the existing pnpm-lock.yaml entries

@tusharpandey13 tusharpandey13 requested a review from a team as a code owner July 20, 2025 18:11
@tusharpandey13 tusharpandey13 enabled auto-merge (squash) July 20, 2025 18:30
@tusharpandey13 tusharpandey13 changed the title security/fix prettier phishing chore: pin eslint-config-prettier and eslint-plugin-prettier versions to prevent malicious package installation Jul 20, 2025
Copy link
Copy Markdown
Contributor

@developerkunal developerkunal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tusharpandey13 tusharpandey13 merged commit e022a2c into master Jul 21, 2025
8 checks passed
@tusharpandey13 tusharpandey13 deleted the security/fix-prettier-phishing branch July 21, 2025 04:56
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.

3 participants