security: require user identity for feedback API submissions#1453
security: require user identity for feedback API submissions#1453yossiovadia wants to merge 1 commit intovllm-project:mainfrom
Conversation
✅ Deploy Preview for vllm-semantic-router ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…oject#1452) The feedback API (POST /api/v1/feedback) accepted unauthenticated requests. Anyone reaching port 8080 could submit fake feedback to manipulate Elo ratings, influencing model selection for all users. Fix: require user identity for every feedback submission. - Read x-authz-user-id header (trusted, from auth backend) first - Fall back to user_id in request body (for dev/testing) - Reject with 401 USER_ID_REQUIRED if neither is present - Use resolved userID in the Feedback object (overrides body value when auth header is present, preventing spoofing) This ties every feedback entry to an authenticated user, enabling per-user audit trails and rate limiting. Fixes vllm-project#1452 Signed-off-by: Yossi Ovadia <yovadia@redhat.com>
542e4e2 to
4d6dda8
Compare
👥 vLLM Semantic Team NotificationThe following members have been identified for the changed files in this PR and have been automatically assigned: 📁
|
|
@yossiovadia would that break the privacy? |
|
The Without requiring identity, anyone who can reach port 8080 can submit thousands of fake feedback entries and shift Elo ratings for all users. We demonstrated this in the security audit. Some options if privacy is a concern:
Open to other ideas. |

Summary
Fixes #1452 — the feedback API (
POST /api/v1/feedback) accepted unauthenticated requests. Anyone reaching port 8080 could submit fake feedback to manipulate Elo ratings, influencing model selection for all users.Fix
Require user identity for every feedback submission:
x-authz-user-id): trusted source from auth backend — takes precedenceuser_id): fallback for development/testing401 USER_ID_REQUIREDThe resolved
userIDoverrides the body value when the auth header is present, preventing spoofing via the request body when an auth backend is configured.Changes
pkg/apiserver/route_feedback.go1 file changed, 18 insertions, 3 deletions.
Test plan
make build-routerpassesgolangci-lint— 0 issues on changed filesuser_idin body accepted (dev/testing path)user_id