π‘οΈ Sentinel: [HIGH] Fix IDOR and Runtime Crashes in Commerce Engine#291
π‘οΈ Sentinel: [HIGH] Fix IDOR and Runtime Crashes in Commerce Engine#291dcplatforms wants to merge 1 commit into
Conversation
- Implemented fleet-ownership authorization in /invoices/generate and /billing/calculate/:sessionId to prevent BOLA/IDOR. - Refactored Commerce Engine endpoints to use correct service logic. - Removed broken legacy code in startServices() causing runtime crashes. - Fixed SyntaxError in Token Engine index.js caused by duplicate declaration. Co-authored-by: dcplatforms <10982057+dcplatforms@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
π‘οΈ Sentinel Security Report
π¨ Severity: HIGH
π‘ Vulnerability:
/billing/calculate/:sessionIdand/invoices/generateendpoints in the Commerce Engine lacked proper validation that the target resources (charging sessions or fleets) belonged to the authenticated user./invoices/generateendpoint was completely non-functional due to undefined variables. Additionally, thestartServicesbootstrap function contained an insecure block of code that used HTTP response objects (res) outside of a request context, causing the service to crash immediately on startup.SyntaxErrorin the Token Engine service (duplicate function declaration) prevented the test suite from running.π― Impact:
fleet_idorsessionId.π§ Fix:
fleet_idchecks against the verified JWT payload in all sensitive Commerce Engine endpoints.InvoicingServiceandBillingServicelogic into the API handlers.startServicesfunction to remove non-functional and crashing code.extractSiteIddeclaration in the Token Engine.β Verification:
npm testinservices/10-token-enginepassed 23/23 tests.node -c.services/09-commerce-engine/index.js.PR created automatically by Jules for task 4186013490316551872 started by @dcplatforms