Repository navigation
Conversation
NiteshMehta
marked this pull request as ready for review
November 17, 2026 16:33
NiteshMehta
requested review from
NiteshMehta,
adganta,
ashokrprogress,
hmadala001,
prgs-rsingh and
rjrudin
as code owners
November 17, 2026 16:33
NiteshMehta
previously approved these changes
Nov 17, 2026
|
@vishwach Please investigate the cause of the build failure. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the request-encoding and session-identifier hardening changes.
No open issues 🎉
What changed in this PR
This PR hardens the Node.js client’s request construction against query-parameter injection in document deletion and increases session identifier randomness.
Changes:
- URL-encodes temporal parameters and transaction IDs to prevent injected query parameters.
- Adds an outgoing-request regression test and updates negative tests to pass unencoded transaction IDs.
- Increases session identifiers from 8 to 16 random bytes and updates the corresponding assertion.
| File | Description |
|---|---|
test-basic/session-state-test.js |
Expects 32-character hexadecimal session identifiers. |
test-basic/documents-remove-url-test.js |
Verifies parameter encoding prevents extra document URIs. |
test-basic/documents-negative.js |
Passes raw invalid transaction IDs to the client. |
lib/session-state.js |
Generates session identifiers using 16 random bytes. |
lib/mlutil.js |
URL-encodes string and object-based transaction IDs. |
lib/documents.js |
URL-encodes temporal collection and system-time values for deletion requests. |
Review effort: Balanced
vishwach
force-pushed
the
MLE-33481
branch
2 times, most recently
from
November 17, 2026 16:44
e7d31f9 to
27a1a1c
Compare
vishwach
requested review from
NiteshMehta
and
a balanced review from Copilot
November 17, 2026 16:46
…lCollection inject an extra uri= into the DELETE, deleting a document the caller never named
prgs-rsingh
approved these changes
Nov 19, 2026
NiteshMehta
approved these changes
Nov 20, 2026
hmadala001
approved these changes
Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
In
lib/documents.js,removeDocumentImpl()previously appendedtemporalCollectionandsystemTimeusing raw string concatenation without URL encoding. If an application passed input containing&or=, additional query parameters (such as extrauri=parameters) could be injected into theDELETE /v1/documentsrequest sent to MarkLogic (CWE-93).Changes
temporalCollectionwithencodeURIComponent()inremoveDocumentImpl().systemTime, handling both string andDatetypes (toISOString()).test-basic/to verify special characters (&,=,/) are properly escaped and do not inject additional query parameters.Verification
%26uri%3D).