Skip to content

Replace deprecated akismet with @cedx/akismet#3585

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/replace-akismet
Draft

Replace deprecated akismet with @cedx/akismet#3585
Copilot wants to merge 2 commits into
mainfrom
copilot/replace-akismet

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 15, 2026

akismet (v2.0.7) has been unmaintained for 4+ years and pulls in several vulnerable transitive deps: form-data (critical), request (SSRF), tough-cookie (prototype pollution), and qs (DoS). @cedx/akismet is the actively maintained replacement recommended by Akismet's official docs, and has zero dependencies (uses native fetch).

Changes

  • packages/server/package.json: swap akismet@^2.0.7@cedx/akismet@^17.1.0
  • packages/server/src/service/akismet.js: rewrite service using the new API — replaces callback-based code with async/await, uses Client/Blog/Author/Comment/CheckResult classes; loaded via dynamic import() to bridge ESM→CJS
  • pnpm-lock.yaml: updated accordingly
// Before: callback-style with deprecated lib
const akismet = Akismet.client({ blog, apiKey: AKISMET_KEY });
akismet.verifyKey(function(err, verified) {
  akismet.checkComment({ user_ip, permalink, comment_author, comment_content }, cb);
});

// After: native async/await, no transitive deps
const { Author, Blog, CheckResult, Client, Comment } = await import('@cedx/akismet');
const client = new Client(AKISMET_KEY, new Blog({ url: blog }));
const isValid = await client.verifyKey();
const result = await client.checkComment(
  new Comment({ author: new Author({ ipAddress, name, email }), content, permalink }),
);
return result !== CheckResult.ham;

Copilot AI linked an issue May 15, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Replace deprecated Akismet implementation Replace deprecated akismet with @cedx/akismet May 15, 2026
Copilot AI requested a review from lizheming May 15, 2026 13:23
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.

replace akismet

2 participants