Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Security: Multiple vulnerabilities found via Snyk Code Analysis (XSS, Path Traversal, ReDoS, Open Redirect)

未關閉
#7,737 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 2 天內回覆

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
25/100
Issue 類型
缺陷
描述清晰度
需要釐清
活躍度
冷清
技術堆疊
node.js, typescript
領域
backend, security

研究方向

首先針對接近 v4.112.0 的 main branch 重新執行 Snyk Code Analysis,然後檢查 src/node/routes/errors.ts、login.ts、vscode.ts、domainProxy.ts、index.ts 和 src/node/app.ts 中回報的位置。將 production 發現與測試檔案中的低嚴重性發現分開,確認每個漏洞,並考慮建議的緩解措施。當已確認的 production 發現都得到處理,且掃描不再回報這些發現時,即表示完成。

由索引模型根據 Issue 內容生成。

描述

bug security

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.ts line 56
  • src/node/routes/login.ts lines 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.ts lines 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.ts line 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.ts lines 62, 99
  • src/node/routes/index.ts line 94
Allocation of Resources Without Limits — CWE-770, Score 555
  • src/node/routes/errors.ts line 37
  • src/node/routes/vscode.ts line 213
Information Exposure via X-Powered-By — CWE-200, Score 554
  • src/node/app.ts line 70
Sensitive Cookie Without Secure/HttpOnly Flags — CWE-614/CWE-1004, Score 402
  • src/node/routes/login.ts line 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 Secure and HttpOnly to session cookies

Happy to submit PRs for any of these if the team confirms the approach.

主要語言
TypeScript
星號
79.4k
分支
6.9k
平均合併
2 天 15 小時
30 天內合併 PR
38

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

coder/code-server 的其他 Issue

查看 coder/code-server 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。