Conversation
- policy.js "unique": the user-supplied value is now escaped with auth/queryFilter.escapeStringValue, so a backslash or quote in it can neither break the _queryFilter literal nor inject predicates - BackgridUtils.queryFilter: escape backslashes before quotes - UserQueryFilterEditor / LinkQualifierFilterEditor: build <option> elements through the DOM API instead of string concatenation; the UserQueryFilterEditor lookup also no longer prefixes an extra "/", which used to add a duplicate option for every known property - PoliciesDialogView: set the default-action stars as text - GenericEditResourceView: strip every escaping backslash from the selector, not only the first one - ReconTypeBase: widen ignoreFields to int Resolves CodeQL alerts #739-#743 (js/incomplete-sanitization), #745-#748 (js/xss-through-dom) and #910 (java/implicit-cast-in-compound-assignment).
This was referenced Sep 18, 2026
- validNameFormat: drop the code points listed twice in the character class - cannotContainDuplicates: declare the loop index - policyProcessor: a missing comma ended the module's var list early, so validate, mergePolicies, getAdditionalPolicies, updateResourceConfig and processRequest leaked into the global scope - drop the dead assignments of validate()'s (undefined) result Resolves CodeQL alerts #768-#770, #782, #783, #895, #896.
4 tasks
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
Closes the remaining high-severity CodeQL alerts:
js/incomplete-sanitization#739–#743,js/xss-through-dom#745–#748 andjava/implicit-cast-in-compound-assignment#910. (#744 was dismissed as a false positive:elementIdis an editor-generated index path, never user text.)#743 —
policy.jsuniquepolicy (the one that matters)The value under validation is user-supplied (it arrives with the create/update request, including self-registration) and was embedded in a
_queryFilterstring literal with only"escaped. A trailing\made the filter unparseable (policy evaluation fails instead of returning a result), and a\"sequence could alter the filter structure. Same class as CVE-2026-62961; the fix reuses theauth/queryFilter.escapeStringValuehelper introduced there.New
policyUniqueTest.jsdrives the realpolicy.js(it is a script, not a module: it is read from the classpath and evaluated with stubbed host globals) and asserts the exact_queryFilterhanded toopenidm.query. Failed onmasterfor the backslash cases.#739 —
BackgridUtils.queryFilterAdmin-UI grid filter text: backslash is now escaped before the quote. No privilege impact (the admin builds their own query), but a
\in the filter box used to break the grid.BackgridUtilsTest.js(previously an empty stub) covers it.#747 / #748 —
LinkQualifierFilterEditor/UserQueryFilterEditorProperty names taken from the stored mapping/role condition were concatenated into
<option value="…">…</option>markup and into a jQuery attribute selector. Options are now built through the DOM API ($("<option>").attr("value", …).text(…)) and matched by comparingoption.value.The new
UserQueryFilterEditorTest.jsalso caught a pre-existing functional bug: the lookup searched for"/" + tempValuealthough the stored name is already a JSON pointer (/mail), so it never matched and appended a duplicate//mailoption for every known property. The pointer is now normalised (/mailkept, baremail→/mail).#745 / #746 —
PoliciesDialogView.html(option.text() + "☆")→.text(option.text() + "☆"); the star characters are literals now (the templates already use a literal☆).#740–#742 —
GenericEditResourceViewselector.replace("\\", "")removed only the first escaping backslash of a\.a\.bselector; for nested relationship properties with more than one dot the JSONEditor path was wrong. Nowreplace(/\\/g, ""). Functional, not security.#910 —
ReconTypeBaseshort ignoreFields→int.Second commit — the remaining warning-level alerts in
policy.js(#768–#770, #782, #783, #895, #896)validNameFormat:\u00D3,\u00F3,\u0178were listed twice in the character class; second occurrences dropped (same semantics).cannotContainDuplicates: the loop indexiwas undeclared and leaked into the global scope.policyProcessor:getAppliedConditionalPoliciesended with}instead of},, so ASI cut the module'svarlist short andvalidate,mergePolicies,getAdditionalPolicies,updateResourceConfigandprocessRequestbecame globals.policyRequirements = validate(…)assignments were dead —validate()reports throughretArrayand returns nothing.Not changed, worth a separate look: the same regex starts with
[A-Za'-\u0105…], which is nota-z'but a range from'(U+0027) toą(U+0105) — it lets digits and most punctuation throughvalidNameFormat. It reads like a typo forA-Za-z', but fixing it would tighten name validation, so it needs a product decision.Test plan
policyUniqueTest.js— fails onmasterfora\andx\" or …, passes here; fullScriptRunnerTest(8 JS test modules, includingpolicyFilterTestwhich also exercisespolicy.js) green viamvn -pl openidm-zip -am packageafter both commitsopenidm-ui-commonbuild green