-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Python: Remove imprecise container steps #17493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
83835da
25e25d5
12fc379
382b3ce
53b1678
ee96655
111c099
2185362
e13a43d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -63,7 +63,8 @@ def get(self, name = "World!", number="0", foo="foo"): # $ requestHandler route | |||||
request.headers["header-name"], # $ tainted | ||||||
request.headers.get_list("header-name"), # $ tainted | ||||||
request.headers.get_all(), # $ tainted | ||||||
[(k, v) for (k, v) in request.headers.get_all()], # $ tainted | ||||||
[(k, v) for (k, v) in request.headers.get_all()][0], # $ tainted | ||||||
list([(k, v) for (k, v) in request.headers.get_all()])[0], # $ tainted | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] Consider unifying the conversion style by using a single approach (either always wrapping comprehensions with list() or directly indexing the comprehension) to maintain consistency and improve clarity.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In a test file like this one, we specifically want to list many different approaches; we want coverage rather than uniformity. |
||||||
|
||||||
# Dict[str, http.cookies.Morsel] | ||||||
request.cookies, # $ tainted | ||||||
|
@@ -73,6 +74,11 @@ def get(self, name = "World!", number="0", foo="foo"): # $ requestHandler route | |||||
request.cookies["cookie-name"].coded_value, # $ tainted | ||||||
) | ||||||
|
||||||
ensure_not_tainted( | ||||||
[(k, v) for (k, v) in request.headers.get_all()], # The comprehension is not tainted, only the elements | ||||||
list([(k, v) for (k, v) in request.headers.get_all()]), # Here, all the elements of the list are tainted, but the list is not. | ||||||
) | ||||||
|
||||||
|
||||||
def make_app(): | ||||||
return tornado.web.Application( | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider adding a clarifying comment that explains why the items extracted from a dictionary are expected to be untainted under the new precise taint tracking semantics.
Copilot uses AI. Check for mistakes.