Skip to content

Improve security baseline and Mongoose 8 compatibility#70

Open
cryptoinsider1 wants to merge 33 commits into
docker:mainfrom
cryptoinsider1:main
Open

Improve security baseline and Mongoose 8 compatibility#70
cryptoinsider1 wants to merge 33 commits into
docker:mainfrom
cryptoinsider1:main

Conversation

@cryptoinsider1

@cryptoinsider1 cryptoinsider1 commented Apr 14, 2026

Copy link
Copy Markdown

Summary

This PR improves the security baseline of the Express todo example.

Changes included:

  • Add CodeQL security scanning workflow for JavaScript/TypeScript.
  • Add SECURITY.md with vulnerability reporting guidance.
  • Update npm dependencies.
  • Add rate limiting to Express routes.
  • Fix Mongoose 8 compatibility in app/routes/front.js by replacing the removed findOneAndRemove() call with findByIdAndDelete().

Latest fix

The latest commit 6af3b7f stabilizes the todo routes for Mongoose 8:

  • validates todo IDs before deletion;
  • prevents invalid database calls;
  • handles database errors safely;
  • ensures routes redirect or render instead of hanging.

Verification

  • CodeQL Advanced completed successfully on the latest commit.
  • The branch has no merge conflicts.
  • Manual route behavior checked conceptually for:
    • GET /
    • POST /
    • POST /todo/destroy
    • invalid or missing todo id
    • database error fallback

Notes

This PR is ready for maintainer review.

dependabot Bot and others added 25 commits January 10, 2025 18:11
Bumps the npm_and_yarn group with 1 update in the /app directory: [braces](https://github.com/micromatch/braces).


Updates `braces` from 3.0.2 to 3.0.3
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](micromatch/braces@3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps the npm_and_yarn group with 2 updates in the /app directory: [cookie](https://github.com/jshttp/cookie) and [express](https://github.com/expressjs/express).


Updates `cookie` from 0.5.0 to 0.7.1
- [Release notes](https://github.com/jshttp/cookie/releases)
- [Commits](jshttp/cookie@v0.5.0...v0.7.1)

Updates `express` from 4.18.2 to 4.21.2
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.2/History.md)
- [Commits](expressjs/express@4.18.2...4.21.2)

---
updated-dependencies:
- dependency-name: cookie
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: express
  dependency-type: direct:production
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
…/npm_and_yarn-5134b82be1

Bump braces from 3.0.2 to 3.0.3 in /app in the npm_and_yarn group across 1 directory
Bumps the npm_and_yarn group with 1 update in the /app directory: [ws](https://github.com/websockets/ws).


Updates `ws` from 7.5.9 to 7.5.10
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](websockets/ws@7.5.9...7.5.10)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps the npm_and_yarn group with 1 update in the /app directory: [mongoose](https://github.com/Automattic/mongoose).


Updates `mongoose` from 7.6.4 to 7.8.3
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](Automattic/mongoose@7.6.4...7.8.3)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps the npm_and_yarn group with 2 updates in the /app directory: [ejs](https://github.com/mde/ejs) and [mongoose](https://github.com/Automattic/mongoose).


Updates `ejs` from 3.1.9 to 3.1.10
- [Release notes](https://github.com/mde/ejs/releases)
- [Commits](mde/ejs@v3.1.9...v3.1.10)

Updates `mongoose` from 7.8.3 to 8.9.5
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](Automattic/mongoose@7.8.3...8.9.5)

---
updated-dependencies:
- dependency-name: ejs
  dependency-type: direct:production
  dependency-group: npm_and_yarn
- dependency-name: mongoose
  dependency-type: direct:production
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps the npm_and_yarn group with 1 update in the /app directory: [brace-expansion](https://github.com/juliangruber/brace-expansion).


Updates `brace-expansion` from 1.1.11 to 1.1.12
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](juliangruber/brace-expansion@1.1.11...v1.1.12)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 1.1.12
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
…p/npm_and_yarn-6ea9762674

Bump brace-expansion from 1.1.11 to 1.1.12 in /app in the npm_and_yarn group across 1 directory
Bumps the npm_and_yarn group with 1 update in the /app directory: [qs](https://github.com/ljharb/qs).


Updates `qs` from 6.13.0 to 6.14.1
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](ljharb/qs@v6.13.0...v6.14.1)

---
updated-dependencies:
- dependency-name: qs
  dependency-version: 6.14.1
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
…p/npm_and_yarn-2b901f0e0d

Bump qs from 6.13.0 to 6.14.1 in /app in the npm_and_yarn group across 1 directory
Bumps the npm_and_yarn group with 2 updates in the /app directory: [minimatch](https://github.com/isaacs/minimatch) and [qs](https://github.com/ljharb/qs).


Updates `minimatch` from 3.1.2 to 10.2.2
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](isaacs/minimatch@v3.1.2...v10.2.2)

Updates `qs` from 6.14.1 to 6.14.2
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](ljharb/qs@v6.14.1...v6.14.2)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-version: 10.2.2
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: qs
  dependency-version: 6.14.2
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
…p/npm_and_yarn-3620e88e6c

Bump the npm_and_yarn group across 1 directory with 2 updates
Bumps the npm_and_yarn group with 1 update in the /app directory: [path-to-regexp](https://github.com/pillarjs/path-to-regexp).


Updates `path-to-regexp` from 0.1.12 to 0.1.13
- [Release notes](https://github.com/pillarjs/path-to-regexp/releases)
- [Changelog](https://github.com/pillarjs/path-to-regexp/blob/v.0.1.13/History.md)
- [Commits](pillarjs/path-to-regexp@v0.1.12...v.0.1.13)

---
updated-dependencies:
- dependency-name: path-to-regexp
  dependency-version: 0.1.13
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
…p/npm_and_yarn-5c00e80ab5

Bump path-to-regexp from 0.1.12 to 0.1.13 in /app in the npm_and_yarn group across 1 directory
Bumps the npm_and_yarn group with 1 update in the /app directory: [picomatch](https://github.com/micromatch/picomatch).


Updates `picomatch` from 2.3.1 to 2.3.2
- [Release notes](https://github.com/micromatch/picomatch/releases)
- [Changelog](https://github.com/micromatch/picomatch/blob/master/CHANGELOG.md)
- [Commits](micromatch/picomatch@2.3.1...2.3.2)

---
updated-dependencies:
- dependency-name: picomatch
  dependency-version: 2.3.2
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
…p/npm_and_yarn-66413a1f6e

Bump picomatch from 2.3.1 to 2.3.2 in /app in the npm_and_yarn group across 1 directory
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Potential fix for code scanning alert no. 1: Missing rate limiting

@cryptoinsider1 cryptoinsider1 left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Latest commit pushed: 6af3b7f.

The Mongoose 8 compatibility issue in the delete route has been fixed by replacing findOneAndRemove() with findByIdAndDelete() and adding safe ObjectId validation/error handling.

CodeQL Advanced passed successfully on the latest commit. The PR is ready for maintainer review.

dependabot Bot and others added 4 commits May 7, 2026 06:54
Bumps the npm_and_yarn group with 1 update in the /app directory: [mongoose](https://github.com/Automattic/mongoose).


Updates `mongoose` from 8.9.5 to 8.22.1
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](Automattic/mongoose@8.9.5...8.22.1)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-version: 8.22.1
  dependency-type: direct:production
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
…p/npm_and_yarn-2d7a5c5b8d

Bump mongoose from 8.9.5 to 8.22.1 in /app in the npm_and_yarn group across 1 directory
Bumps the npm_and_yarn group with 2 updates in the /app directory: [brace-expansion](https://github.com/juliangruber/brace-expansion) and [qs](https://github.com/ljharb/qs).


Updates `brace-expansion` from 5.0.3 to 5.0.6
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](juliangruber/brace-expansion@v5.0.3...v5.0.6)

Updates `minimatch` from 5.1.6 to 10.2.2
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](isaacs/minimatch@v5.1.6...v10.2.2)

Updates `qs` from 6.14.2 to 6.15.2
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](ljharb/qs@v6.14.2...v6.15.2)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 5.0.6
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: minimatch
  dependency-version: 10.2.2
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: qs
  dependency-version: 6.15.2
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
…p/npm_and_yarn-4176159d45

Bump the npm_and_yarn group across 1 directory with 3 updates
dependabot Bot and others added 4 commits June 12, 2026 21:35
Bumps the npm_and_yarn group with 1 update in the /app directory: [minimatch](https://github.com/isaacs/minimatch).


Updates `minimatch` from 10.2.2 to 10.2.5
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](isaacs/minimatch@v10.2.2...v10.2.5)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-version: 10.2.5
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
…p/npm_and_yarn-c0e00ee424

Bump minimatch from 10.2.2 to 10.2.5 in /app in the npm_and_yarn group across 1 directory
@cryptoinsider1 cryptoinsider1 changed the title * Improve security baseline and Mongoose 8 compatibility Jun 12, 2026
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.

1 participant