[False Negative/Question] Taint steps added by `isAdditionalFlowStep` ignore tainted content
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
- 35/100
Hướng nghiên cứu
Bắt đầu với predicate isAdditionalFlowStep và so sánh hành vi của nó với các bản tóm tắt luồng trong tài liệu data-flow của CodeQL. Tái hiện ví dụ Go Container và xác định liệu nội dung tainted lồng nhau có bị loại trừ một cách có chủ đích hay nên được hỗ trợ. Hoàn thành khi hành vi và lý do đã được làm rõ, với một hướng giải quyết được ghi lại hoặc triển khai.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
When modelling a gRPC library in Go, I noticed that steps added to global taint tracking via the isAdditionalFlowStep predicate do not cover cases where the object passed to the step has tainted content, but is not considered tainted itself.
Example code for the issue below:
type Container = struct{ Value int }
func link_in(Container) {
// magic CodeQL does not understand
}
func link_out() Container {
// more magic
// returns the argument of link_in
panic(0)
}
func main() {
a := Container{Value: taint()}
link_in(a)
a_ := link_out()
sink(a_.Value)
}
The link_in and link_out functions represent two places that pass data between them, but which CodeQL does not connect out of the box. Adding an additional flow step to establish this connection will only work if we consider the entire Container struct to be tainted; the taint on Container.Value in the example above is ignored.
After experimenting a bit, this behaviour seems consistent across different languages, which leads me to believe it was an intentional decision. However, I do not fully understand the reasoning behind it. Many libraries wrap their data in some kind of container (for example, the code emitted by the Go gRPC tooling generates custom structs for the message types in the protobuf), and the mechanisms provided by flow summaries are not always sufficient to model this (The above example can be solved by introducing a write/read to a synthetic global variable unique to this function pair, however that only works if the functions with this special behaviour are known in advance).
Since flow summaries can handle tainted content, would it be possible to do the same for isAdditionalFlowStep? Dropping the taint to the level of the entire containing struct is not always a worthwhile option, so this mechanism would be very helpful when modelling more complex library behaviour.
If this is a deliberate design decision, I feel like it should be mentioned in the data-flow tutorial.
- Ngôn ngữ chính
- CodeQL
- Star
- 10.1k
- Fork
- 2.1k
- Merge trung bình
- 2 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 129
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 github/codeql
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
C#: cs/simplifiable-boolean-expression false positive on Nullable<bool> compared with a literal Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
false-positive
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
False positive Đang mởfalse-positive
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 15/100
Tất cả issue của github/codeql
Issue tương tự
-
스택 PR 머지 시 하위 PR base 재지정 단계 부재 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
idean3885/claude-ops-agent#521 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
0xMiden/bridge-portal#132 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
newrelic-experimental/preflight#793 · 1 bình luận ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
babalae/bettergi-scripts-list#3674 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
caddyserver/caddy#8046 ·