This is a bug bounty issue for SecureBananaLabs, requiring an authentication middleware to be enforced on the job creation POST endpoint. The task involves adding a line of code to apply existing authentication logic to prevent unauthenticated job postings. This is a clear, self-contained task with a defined monetary reward.
A starter prompt for Claude Code, what you'll need, and how to reach them.
You are an expert full-stack developer. Your task is to implement an authentication enforcement fix for a job creation endpoint in a Node.js Express application. Fork the `SecureBananaLabs/bug-bounty` repository. Locate the file `apps/api/src/routes/jobRoutes.js`. Modify the line `jobRoutes.post("/", postJob);` to include an `authMiddleware`. Assume `authMiddleware` is already defined and imported in the file or easily accessible within the project's existing middleware setup (you may need to add an import if missing, looking for existing middleware definitions like `authMiddleware` or `verifyAuth`). After applying the fix, outline how to verify that unauthenticated POST requests to `/api/jobs` are correctly rejected. Focus on a minimal, correct change. The project uses Node.js and Express. Provide the exact modified line of code and the verification steps. Remember to add any necessary `import` or `require` statements for the middleware. If the middleware is not immediately obvious, suggest a sensible place where it would typically be defined or imported within a standard Express project structure (e.g., from a `middleware` directory).Bounty (amount on the issue). ## Bug: Missing Authentication on Job Creation **Description:** The `POST /api/jobs` endpoint does not require authentication. Anyone can create job listings without being logged in. **File:** `apps/api/src/routes/jobRoutes.js` **Current code:** ```js jobRoutes.get("/", getJobs); jobRoutes.post("/", postJob); ``` **Expected behavior:** The POST route should require `authMiddleware` to ensure only authenticated users can create jobs. **Impact:** Medium — spam or malicious job postings could flood the platform. This issue is limited only to the creator of this issue. This means that only the issue author can attempt to solve this issue. If you would like to work on it, please create another issue with the same contents and refer to issue #743 for more information.
Standard for any GitHub-based project.
Standard for JavaScript backend development.
Core skill for Node.js/Express development.
Reply to the GitHub issue #1783 with a comment indicating intent to solve and asking for clarification on how to submit the fix and claim the bounty. Also, open a draft PR once a working solution is in progress.
“I've reviewed issue #1783 and have a clear path to implementing the `authMiddleware` for the `/api/jobs` endpoint. I've already forked the repo and have a working local fix. I can submit a PR shortly and would appreciate guidance on the bounty claim process.”
Open the original ↗