Address deprecation of PathExpr
and port ZipSlipQuery
#230
+137
−165
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What This PR Contributes
Rewrite
XSJSZipSlip
with new data flow APIsXSJSZipSlip was the only query that wasn't ported to the newer data flow API in PR #220. This PR not only ports the query to using the newer API, it rewrites the entire query to be visually and conceptually cleaner.
WebRequestBody as unified RemoteFlowSource
Previously, methods
asArrayBuffer
,asString
, andasWebRequest
on these types were RemoteFlowSources on their own:$.request
and$.request.entities.*
in source code)$.net.http.Client::getResponse().body()
in source code)This made alert reporting a bit perplexing both conceptually and practically, as (1) these method calls could be mistaken as a side-effecting entrypoint that pulls data in, and (2) the data flow as reported starts from the call to these methods and not the actual request body or a response.
Therefore, we place the WebRequestBody on the sourceModel and leave only the InboundResponse on the sourceModel, and calls to the above three methods on the summaryModel.
Clean up, port, and streamline XSJSZipSlipQuery
XSJSZipInstanceDependingOnRemoteFlowSource
is unnecessary when we have a combination of (1) unified RemoteFlowSource discussed above, (2) the data flow that starts from it, and (3) a stateful data flow config (enforcing the taint tracking to filter out flows that does not have anXSJSZipInstance
along the way).XSJSRemoteFlowSourceToZipInstanceStep
is a special case of a kind of step already covered by the data flow library.ZipEntryPathIndexOfCallEqualsZeroGuard
to useDataFlow::MakeBarrierGuard
.ForInLoopDomainToVariableStep
to a query-dependent step, from being a SharedFlowStep.Replace deprecated
PathString
withFileSystem::Folder::Resolve
PathString
is deprecated, so useFileSystem::Folder::Resolve<shouldResolve/2>::resolve
whereshouldResolve
restricts the possible set of(container, path)
pairs using the predefinedisAnUnResolvedResourceRoot
.Miscellaneous
xsjs.model.yml
.webBody.qll
.Future Works
DbLocation
inListXssPartialPaths
.