Accio Connect is a monorepo (frontend/ + backend/) under active development.
Security fixes are applied to the latest main branch only.
| Component | Version / Branch | Supported |
|---|---|---|
frontend (React 19 + Vite 7, accio-connect-frontend@0.0.0) |
main (latest) |
✅ |
backend (Express 5 + Mongoose 9, accio-connect-server@1.0.0) |
main (latest) |
✅ |
| Older tags / forks / deployed previews | — | ❌ (upgrade to main) |
Key dependencies to keep current: express, mongoose, jsonwebtoken,
bcryptjs, cookie-parser, cors, dotenv, axios, react-router-dom,
@reduxjs/toolkit, vite.
Please do not open a public GitHub issue for a security vulnerability.
Report privately via one of these channels:
- GitHub → Security tab → Report a vulnerability (private advisory), or
- Open an issue titled
[SECURITY]only if it contains no exploit details, and ask the maintainer for a private contact — or contact repository ownersai4u-devdirectly via their GitHub profile email.
Include:
- Affected component (
frontend/backend), file + line if known (e.g.backend/src/app.js:26,backend/src/middleware/auth.middleware.js) - Steps to reproduce / proof-of-concept (redact real credentials)
- Impact assessment (auth bypass, data leak, XSS, CSRF, etc.)
- Suggested fix, if any
You can expect:
- Acknowledgement within 72 hours
- A fix or mitigation plan on
mainwithin 14 days for High/Critical issues - Credit in the release notes if desired (or anonymity on request)
- Auth: JWT (
JWT_SECRET, 7-day expiry) issued atPOST /api/auth/signin, transported inaccioConnectTokencookie (httpOnly,secure,sameSite:none) and optionally asAuthorization: Bearer <token>. Verified inbackend/src/middleware/auth.middleware.js, which loads the fullUser(minus password) ontoreq.user. - Passwords: Hashed with
bcryptjs(cost 12) inbackend/src/controllers/auth.controller.js. Never returned (select: false+ explicit strip beforeres.success). - Transport: CORS allowlist in
backend/src/app.js:http://localhost:5173+ two Vercel production origins,credentials: true. Cookie-based auth requires HTTPS in production (secure: true). - Input validation: Batch / location / course-type enums checked against
backend/src/constants.js(OBH_1/2/3, 5 centres,mern/java/da); required-field + unique-email/phone checks on signup. - Responses: Standard envelope via
backend/src/utils/response.js(res.success/res.err); unhandled errors viabackend/src/middleware/error.middleware.js(stack traces only whenNODE_ENV=development).
These are real observations from the current codebase — do not exploit them, please fix them via PR:
GET /admin(backend/src/app.js) is unauthenticated and reads a log file asynchronously with a race condition (admin.controller.js). → Require auth + admin role, fix async flow, move logs out ofsrc/.POST /api/auth/logouthas noauthmiddleware andclearCookieoptions (secure:false, sameSite:lax) don't matchsignincookie options (secure:true, sameSite:none) — the session cookie may persist. → Addauthmiddleware, align cookie flags, handle HTTPS vs localhost.- Six model files (
connection,conversation,message,notification,placement,referral) are missingrequire("mongoose")and crash if imported. They are currently dead code (onlyUser+Postare wired). → Add the import, add tests thatrequire()every model. - No rate limiting / brute-force protection on
/api/auth/signin|signup, no account lockout (the enterpriseuserSchema.jsdesign hasloginAttemptsbut is unwired). → Addexpress-rate-limit. GET /api/auth/getallusersusesrouter.use(matches all verbs), has no pagination, and returns all users via rawres.json(bypasses envelope). → Change torouter.get, add pagination + field projection + role check.GET /api/post/(list all posts) is public with no pagination. → Consider auth + pagination (limit/page) before dataset grows.secure: truecookies fail overhttp://localhostduring local dev. → Document env-based cookie flags (secure: NODE_ENV==="production").- No
helmet, no input sanitization library,PORThardcoded to8000(ignoresprocess.env.PORT), MongoDB connects via a singleMONGO_URIwith no allowlist documentation.
All PRs must follow these rules:
- Never commit secrets.
.env,.env.*,*.envare gitignored at the repo root (see.gitignore). Required vars:- Backend:
MONGO_URI,JWT_SECRET(long random string, ≥32 bytes) - Frontend:
VITE_BACKEND_API_URL(e.g.http://localhost:8000/api)
- Backend:
- Never commit real credentials or dumps. The repo contains a
user.txtwith demo emails/passwords — do not extend it with real user data. Rotate any credential that was ever committed. - Validate + authorize server-side. Every
POST/PUT/DELETE /api/post/*(except publicGET /api/post/) must keepauthorize; add ownership checks (post.user.toString() === req.user.id) as done inupdatePost/deletePost. - Keep auth cookies safe.
httpOnlyalways;secure+sameSite:nonein production (HTTPS); test logout clears the exact same flags. - Least privilege queries. Use
.select("-password"), paginate list endpoints, never return password hashes or backup codes/MFA secrets. - Update dependencies. Run
npm auditinbackend/andfrontend/before release PRs; fix High/Critical findings.
# backend/.env (never commit)
MONGO_URI=mongodb+srv://<user>:<pass>@<cluster>/accio-connect
JWT_SECRET=<openssl rand -hex 32>
PORT=8000
NODE_ENV=development
# frontend/.env (never commit)
VITE_BACKEND_API_URL=http://localhost:8000/api