C# False Positive Suggestion PathBase
- Ngôn ngữ chính
- CodeQL
- Star
- 10.1k
- Fork
- 2.1k
- Merge trung bình
- 2 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 141
Mô tả
**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));
```
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu với truy vấn C# XSS và cách truy vấn này mô hình hóa Context.Request.PathBase dưới dạng Remote Flow Source. Xác nhận PathBase được phân loại như thế nào, sau đó kiểm tra rằng giá trị được hiển thị không còn được xem là một source; issue không cung cấp đường dẫn tệp hoặc đường dẫn kiểm thử, vì vậy cần tìm kiếm trong repository.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- csharp
- Lĩnh vực
- security
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100