Skip to content

fix: the post /reset endpoint in git_routes in git_routes.ts#41779

Open
orbisai0security wants to merge 1 commit intoappsmithorg:releasefrom
orbisai0security:fix-v-003-git-reset-auth-middleware
Open

fix: the post /reset endpoint in git_routes in git_routes.ts#41779
orbisai0security wants to merge 1 commit intoappsmithorg:releasefrom
orbisai0security:fix-v-003-git-reset-auth-middleware

Conversation

@orbisai0security
Copy link
Copy Markdown

@orbisai0security orbisai0security commented May 6, 2026

Summary

Fix high severity security issue in app/client/packages/rts/src/routes/git_routes.ts.

Vulnerability

Field Value
ID V-003
Severity HIGH
Scanner multi_agent_ai
Rule V-003
File app/client/packages/rts/src/routes/git_routes.ts:9

Description: The POST /reset endpoint in git_routes.ts at line 9 chains only validator.validateRequest and gitController.reset — no authorization middleware is present in the route definition to verify that the requesting user holds a role (developer or admin) with write access to the target workspace. A lower-privileged user (e.g., viewer role) who discovers this endpoint can submit a valid request body that passes schema validation and trigger a git reset, reverting the application to an arbitrary prior commit.

Changes

  • app/client/packages/rts/src/routes/git_routes.ts

Verification

  • Build passes
  • Scanner re-scan confirms fix
  • LLM code review passed

Automated security fix by OrbisAI Security

Summary by CodeRabbit

  • Chores
    • Added internal authentication requirement for git route operations to enhance security.

Automated security fix generated by Orbis Security AI
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e00dfbba-f1de-4d6c-85ff-bee6ab92e857

📥 Commits

Reviewing files that changed from the base of the PR and between 287f1cd and afe8386.

📒 Files selected for processing (1)
  • app/client/packages/rts/src/routes/git_routes.ts

Walkthrough

Added internal authentication middleware to git routes that validates a request header against an environment variable, returning 403 if the key is invalid. The middleware is applied before existing validation and controller logic.

Changes

Internal Authentication for Git Routes

Layer / File(s) Summary
Type Imports
app/client/packages/rts/src/routes/git_routes.ts (lines 1–6)
Express types (Request, Response, NextFunction) and StatusCodes imported to support middleware and status responses.
Auth Middleware
app/client/packages/rts/src/routes/git_routes.ts (lines 11–21)
requireInternalAuth middleware validates internal key from request header against environment variable; returns 403 Forbidden if invalid, otherwise proceeds.
Router Wiring
app/client/packages/rts/src/routes/git_routes.ts (lines 22–27)
POST route now chains requireInternalAuth before existing validation and controller handler.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

A guardian at the gate stands tall,
Checking keys against the hall,
No password? 403's the call,
Git routes now protected, one and all! 🔐

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title references the POST /reset endpoint fix but includes redundant file path mention, making it slightly verbose and unclear whether 'git_routes in git_routes.ts' is intentional.
Description check ✅ Passed The description provides detailed vulnerability context, clear change summary, and verification steps, but deviates significantly from the template structure which requires issue links, automation tags, and communication checkboxes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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