[RHIDP-13060] harden lightspeed proxy against arbitrary routes#2970
[RHIDP-13060] harden lightspeed proxy against arbitrary routes#2970karthikjeeyar merged 4 commits intoredhat-developer:mainfrom
Conversation
Code Review by Qodo
Context used✅ Tickets:
🎫 Open proxy surface to LCS 1. isAllowedProxyPath lacks normalization
|
Changed Packages
|
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
7f81efc to
e0d3af5
Compare
Review Summary by QodoAdd route allowlist to harden lightspeed proxy security
WalkthroughsDescription• Adds explicit allowlist for LCORE proxy routes to prevent arbitrary endpoint access • Moves passthrough paths to constants for better maintainability • Implements path validation middleware to reject non-allowlisted requests • Adds comprehensive test coverage for allowlist validation logic Diagramflowchart LR
A["Request to /api/lightspeed/*"] --> B["Check PROXY_PASSTHROUGH_PATHS"]
B -->|Match| C["Skip validation"]
B -->|No match| D["Check ALLOWED_PROXY_PREFIXES"]
D -->|Allowed| E["Proxy to LCORE"]
D -->|Blocked| F["Return 404 error"]
File Changes1. workspaces/lightspeed/plugins/lightspeed-backend/src/service/constant.ts
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2970 +/- ##
========================================
Coverage 60.56% 60.56%
========================================
Files 2005 2005
Lines 62781 62788 +7
Branches 16366 16370 +4
========================================
+ Hits 38023 38030 +7
+ Misses 24244 24141 -103
- Partials 514 617 +103
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
|
/review |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
For reviewers in response to Qodo's review:
|
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
|




Hey, I just made a Pull Request!
Issue: https://redhat.atlassian.net/browse/RHIDP-13060
✔️ Checklist