Security: Multiple vulnerabilities found via Snyk Code Analysis (XSS, Path Traversal, ReDoS, Open Redirect)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- node.js, typescript
Hướng nghiên cứu
Bắt đầu bằng cách chạy lại Snyk Code Analysis trên main branch gần v4.112.0, sau đó xem xét các vị trí được báo cáo trong src/node/routes/errors.ts, login.ts, vscode.ts, domainProxy.ts, index.ts và src/node/app.ts. Phân tách các phát hiện trong production khỏi các phát hiện mức độ nghiêm trọng thấp trong các tệp test, xác nhận từng lỗ hổng và cân nhắc các biện pháp giảm thiểu được đề xuất. Hoàn tất khi các phát hiện trong production đã được xác nhận được xử lý và bản quét không còn báo cáo chúng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Snyk Code Analysis identified 65 issues across 92 analyzed files in code-server. The High severity findings affect production deployments.
High Severity (7 issues)
Cross-site Scripting (XSS) — CWE-79, Score 807
src/node/routes/errors.tsline 56src/node/routes/login.tslines 68, 119
User-controlled input may be rendered without proper HTML escaping in error and login responses.
Path Traversal — CWE-23, Score 804
src/node/routes/vscode.tslines 149, 219
User-supplied path components may allow reading files outside the intended directory.
Regular Expression Denial of Service (ReDoS) — CWE-400, Score 752
src/node/routes/domainProxy.tsline 46
A regex pattern may cause catastrophic backtracking with crafted input.
Medium Severity (14 issues)
Open Redirect — CWE-601, Score 557
src/node/routes/login.tslines 62, 99src/node/routes/index.tsline 94
Allocation of Resources Without Limits — CWE-770, Score 555
src/node/routes/errors.tsline 37src/node/routes/vscode.tsline 213
Information Exposure via X-Powered-By — CWE-200, Score 554
src/node/app.tsline 70
Sensitive Cookie Without Secure/HttpOnly Flags — CWE-614/CWE-1004, Score 402
src/node/routes/login.tsline 96
Low Severity (44 issues)
Primarily in test files (hardcoded passwords, cleartext HTTP). Not production concerns.
Reproduction
Scanned with Snyk Code Analysis on code-server main branch (commit near v4.112.0).
Suggested Fixes
- XSS: HTML-encode user input before rendering in error/login templates
- Path Traversal: Resolve and validate paths against intended root directory
- ReDoS: Simplify or replace the vulnerable regex pattern
- Open Redirect: Validate redirect URLs against an allowlist
- X-Powered-By: Disable with
app.disable('x-powered-by') - Cookie flags: Add
SecureandHttpOnlyto session cookies
Happy to submit PRs for any of these if the team confirms the approach.
- Ngôn ngữ chính
- TypeScript
- Star
- 79.4k
- Fork
- 6.9k
- Merge trung bình
- 2 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 39
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 coder/code-server
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
coder/code-server#8017 · 2 bình luận ·
-
Bump proxy-addr to 2.0.8 Đang mởsecurity
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
coder/code-server#8013 · 4 bình luận ·
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
coder/code-server#7976 · 2 bình luận ·
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
coder/code-server#7962 · 3 bình luận ·
-
bug needs-investigation
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
coder/code-server#7955 · 1 bình luận ·
Tất cả issue của coder/code-server
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
safetrustcr/dApp-SafeTrust#426 ·
-
area:workflow bug ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
fil-donadoni/tolaria#4409 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Fission-AI/OpenSpec#1960 ·
-
Add dependabot Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
corsairdev/corsair#1764 ·