Skip to content

fix(proposals): require authentication on POST /api/proposals - #11563

Open
aguayosanti99-design wants to merge 1 commit into
SecureBananaLabs:mainfrom
aguayosanti99-design:fix/proposals-auth-middleware-2773
Open

fix(proposals): require authentication on POST /api/proposals#11563
aguayosanti99-design wants to merge 1 commit into
SecureBananaLabs:mainfrom
aguayosanti99-design:fix/proposals-auth-middleware-2773

Conversation

@aguayosanti99-design

Copy link
Copy Markdown

Problem

The POST /api/proposals endpoint at apps/api/src/routes/proposalRoutes.js was missing authMiddleware, allowing unauthenticated users to submit proposals to any job listing.

Root cause

// Before
proposalRoutes.post("/", postProposal);

No bearer-token validation was applied to the POST handler.

Fix

// After
proposalRoutes.post("/", authMiddleware, postProposal);

Added authMiddleware so only requests with a valid JWT can create proposals. The GET /api/proposals endpoint is intentionally left public.

Tests

Added apps/api/src/tests/proposals.test.js with two cases:

  • Unauthenticated POST returns 401
  • Unauthenticated GET returns 200

Closes #2773

The POST /api/proposals endpoint was accessible without a valid JWT,
allowing any unauthenticated request to create proposals.

Add authMiddleware to the route so only authenticated users can submit
proposals. The GET endpoint remains publicly accessible.

Closes SecureBananaLabs#2773
github-actions Bot added a commit that referenced this pull request Aug 3, 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.

POST /api/proposals endpoint missing authentication middleware (reissue via #743)

2 participants