github / github/codeql

C# False Positive Suggestion PathBase

未關閉
#13,709 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
acknowledged C# false-positive
主要語言
CodeQL
星號
10.1k
分支
2.1k
平均合併
2 天 15 小時
30 天內合併 PR
141

描述

**Description of the false positive**

Context.Request.PathBase should not be included as a Remote Flow Source. From my understanding of PathBase, PathBase is usually decided by the server/proxy and therefore is not controllable by a user, but a requirement for accessing an endpoint. Below is an alert I received from the C# XSS query that took PathBase as its source.

**Code samples or links to source code**

```csharp
var bundleAsset = GetOrCreateBundle(bundleKey, CreateCssAsset, sources);

var pathBase = _actionContextAccessor.ActionContext?.HttpContext.Request.PathBase ?? PathString.Empty; <--- PathBase here
result.AppendFormat("",
MimeTypes.TextCss, pathBase, bundleAsset.Route, bundleAsset.GenerateCacheKey(httpContext, woConfig));
```

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

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

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