Address deprecation of PathExpr and port ZipSlipQuery
#230
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
XSJSZipSlipwith 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, andasWebRequeston these types were RemoteFlowSources on their own:$.requestand$.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
XSJSZipInstanceDependingOnRemoteFlowSourceis 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 anXSJSZipInstancealong the way).XSJSRemoteFlowSourceToZipInstanceStepis a special case of a kind of step already covered by the data flow library.ZipEntryPathIndexOfCallEqualsZeroGuardto useDataFlow::MakeBarrierGuard.ForInLoopDomainToVariableStepto a query-dependent step, from being a SharedFlowStep.Replace deprecated
PathStringwithFileSystem::Folder::ResolvePathStringis deprecated, so useFileSystem::Folder::Resolve<shouldResolve/2>::resolvewhereshouldResolverestricts the possible set of(container, path)pairs using the predefinedisAnUnResolvedResourceRoot.Miscellaneous
xsjs.model.yml.webBody.qll.Future Works
DbLocationinListXssPartialPaths.