-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
JS: Taint propagation from low-level ArrayBuffer
to Strings
#19231
Conversation
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.
Pull Request Overview
This pull request introduces taint propagation for low-level byte-related objects in JavaScript, ensuring that taints are maintained from ArrayBuffer through various TypedArray operations into string conversions.
- Introduces taint propagation for Uint8Array, ArrayBuffer, and SharedArrayBuffer operations.
- Adds taint tracking for TextDecoder.decode() and byte-to-string operations.
Reviewed Changes
Copilot reviewed 2 out of 7 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
javascript/ql/test/library-tests/TaintTracking/typed-arrays.js | Adds tests for taint propagation across different TypedArray and ArrayBuffer operations |
javascript/ql/lib/change-notes/2025-04-07-typed-arrays.md | Documents the minor analysis update related to taint propagation changes |
Files not reviewed (5)
- javascript/ql/lib/semmle/javascript/internal/flow_summaries/AllFlowSummaries.qll: Language not supported
- javascript/ql/lib/semmle/javascript/internal/flow_summaries/Decoders.qll: Language not supported
- javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll: Language not supported
- javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected: Language not supported
- javascript/ql/test/query-tests/Security/CWE-522-DecompressionBombs/DecompressionBombs.expected: Language not supported
Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused. Learn more
javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll
Outdated
Show resolved
Hide resolved
javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll
Outdated
Show resolved
Hide resolved
javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll
Outdated
Show resolved
Hide resolved
javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll
Outdated
Show resolved
Hide resolved
javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll
Outdated
Show resolved
Hide resolved
javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll
Outdated
Show resolved
Hide resolved
javascript/ql/lib/semmle/javascript/internal/flow_summaries/Decoders.qll
Outdated
Show resolved
Hide resolved
javascript/ql/lib/semmle/javascript/internal/flow_summaries/Decoders.qll
Outdated
Show resolved
Hide resolved
Co-authored-by: Asgerf <asgerf@github.com>
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.
One last comment otherwise LGTM
javascript/ql/lib/semmle/javascript/internal/flow_summaries/Strings.qll
Outdated
Show resolved
Hide resolved
…rings.qll Co-authored-by: Asger F <asgerf@github.com>
This pull request introduces taint modeling for the most commonly used
TypedArray
, specifically the Uint8Array, which is primarily utilized in byte-to-string operations. It excludes otherTypedArray
types, such as Int32Array, as they are generally not associated with taint propagation.Additionally, this update adds support for
ArrayBuffer
andSharedArrayBuffer
, which are frequently used in low-level operations and are often passed toTypedArray
constructors.Finally, the pull request includes taint propagation for
TextDecoder
, as it plays a key role in convertingArrayBuffer
orTypedArray
data intoStrings
.