CodeQL flags request host and path reaching slog in plugins
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 60/100
Hướng nghiên cứu
The log calls are in core/cost/settle/settle.go, core/plugins/a2aparser/plugin.go, core/plugins/contextguru/plugin.go, core/plugins/cpex/manager_cpex.go, and the other plugin files listed in the issue, each at the given line numbers. Start by finding pipeline.SanitizeLogValue, the helper added in #1616, and check how it is called there. Then wrap every pctx.Host and pctx.Path passed to slog in it. Done when a PR touching these lines raises no go/log-injection alerts in CodeQL.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
CodeQL (go/log-injection, medium) will flag plugins that pass pctx.Host or pctx.Path to slog.* unsanitized. Both values are client-controlled. pctx.Host comes from the Host header. pctx.Path is the percent-decoded URL path, so a %0A in a request becomes a real newline in the log line.
Call sites, by log message. Line numbers are as of main at 5ba75a0:
- cost/settle (
core/cost/settle/settle.go:225,:229) —refused an implausible cost header,refused a cost header larger than any inference call could plausibly be - a2a-parser (
core/plugins/a2aparser/plugin.go:60,:76) —invalid JSON-RPC,not an A2A-namespace method - context-guru (
core/plugins/contextguru/plugin.go:253,:273) —skipped request with no session identity, and the per-request summary line - cpex (
core/plugins/cpex/manager_cpex.go:587) —body modification requested but no protocol extension present - ibac (
core/plugins/ibac/plugin.go:528,:541) —judge uncertain,judge unavailable - inference-parser (
core/plugins/inferenceparser/plugin.go:90) —no/invalid body - mcp-parser (
core/plugins/mcpparser/plugin.go:187,:203,:226,:241) —session terminate,transport stream,body is not valid JSON-RPC,not an MCP-namespace method - opa (
core/plugins/opa/plugin.go:441,:493) —decision error on request,decision error on response - sparc (
core/plugins/sparc/plugin.go:427,:431,:450) —reflector unavailable, failing open,reflector unavailable, failing closed,no inference context to ground against - token-exchange-aiac (
core/plugins/tokenexchangeaiac/plugin.go:414,:418,:424,:458,:462) —audience exists but is not granted to this workload,the destination's client is disabled,token exchange failed(twice),host in another namespace names a target
Status
CodeQL reports only flows that pass through lines a PR changes, so any PR that edits code on a path to one of these sites will raise the alert. #1612 and #1533 had the same problem in the listeners and the session store. Found in review of #1616.
Fix
Wrap each value in pipeline.SanitizeLogValue, the helper #1616 added, which CodeQL recognizes as a log-injection sanitizer. Done when a PR that touches these log lines raises no go/log-injection alerts.
- Ngôn ngữ chính
- Go
- Star
- 23
- Fork
- 44
- Merge trung bình
- 14 giờ 38 phút
- Pull request đã merge (30 ngày)
- 254
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của rossoctl/cortex
-
feature: let `session.archive` set where it writes, so a second Cortex can keep its own sessionsĐang mởenhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 54/100
Maintainer thường phản hồi trong vòng 1 ngày
-
feature: agentop observe — show a request and its response as one rowCó thể đã có người làm @huang195 đã nhận hôm nay. Đang mởenhancement ux
rossoctl/cortex#1681 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feature: agentop observe — search user prompts and agent responses across a session's eventsCó thể đã có người làm @huang195 đã nhận hôm nay. Đang mởenhancement ux
rossoctl/cortex#1680 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feedback laptop
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 28/100
Maintainer thường phản hồi trong vòng 1 ngày
-
chore: Remove the decline_responses_websockets translation after a deprecation releaseCó thể đã có người làm @Alan-Cha đã nhận 4 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
rossoctl/cortex#1625 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của rossoctl/cortex
Issue tương tự
-
agent-butler-finding chore
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
jordansmall/spindrift#6695 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
skills-init: commit-SHA skill refs never start (git checkout -- <sha> reads the SHA as a pathspec)Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
kagent-dev/kagent#3571 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
book-layout.spec fails when the similar-books rail holds other projects' booksCó thể đã có người làm @praetorianer777 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
praetorianer777/GoTome#373 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
-
/shutdown/ready can fail to return an HTTP response when readiness takes longer than the server write timeoutCó thể đã có người làm @floriankoch đã nhận hôm nay. Đang mởtriage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
envoyproxy/gateway#10562 ·
Maintainer thường phản hồi trong vòng 1 ngày