Update web app, restore Assent branding, and fix XSS/code-injection - #86
Merged
Merged
Conversation
ErrorView: sanitize each errorMessages array item via renderSafeMarkdown
(markdown + sanitize-html allowlist) before dangerouslySetInnerHTML,
matching the singular errorMessage path. Closes an unsanitized XSS sink
fed by bulk-approval Key/Value data and user-supplied upload filenames.
sharedHelpers: replace new Function('return ' + condition)() with an
eval-free expression evaluator that only accepts literals plus an
allowlist of operators, members, and properties; insert property values
via JSON.stringify so a value containing a quote stays an inert literal.
Also define the missing CONDITION_SAFE_METHODS/CONDITION_SAFE_PROPS
allowlists that were referenced but never declared (member-access
conditions previously threw and silently fell back).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Port the latest React app sources from the internal implementation while scrubbing internal-only content (internal folder, tenant configs, and internal references). Public config files are left as sanitized templates. READMEs: restore the public "Assent" project branding, the ASSENT acronym and original product description, and the License, Contributing, Code of Conduct, and Trademarks sections in the top-level reactjs README; rebrand the nested READMEs from "Microsoft Approvals" to "Microsoft Assent" and to "Approvals Backend API". Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
guid() backed correlationId, which flows into the X-Session-Id request header (a security context). Replace Math.random() with crypto.randomUUID() and a crypto.getRandomValues() fallback that sets the RFC 4122 v4 version/variant bits, so no insecure randomness reaches a security-sensitive sink. Clears the two high-severity CodeQL alerts on AdminPage.api.ts (fetchApi/patchApi). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Chinmaya (cr-chinmaya)
approved these changes
Sep 8, 2026
Eshani Mishra (emishra)
enabled auto-merge
September 8, 2026 22:40
v-ragjos
approved these changes
Sep 8, 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
Syncs
source/reactjswith the latest internal implementation and hardens two security-sensitive rendering paths.Security fixes
ErrorView.tsx— eacherrorMessagesarray item is now sanitized viarenderSafeMarkdown(markdown + sanitize-html allowlist) beforedangerouslySetInnerHTML, matching the singularerrorMessagepath. Closes an unsanitized sink fed by bulk-approval Key/Value data and user-supplied upload filenames.sharedHelpers.tsx— replacesnew Function('return ' + condition)()with an eval-free expression evaluator that only accepts literals plus an allowlist of operators, members, and properties; property values are inserted viaJSON.stringifyso a value containing a quote stays an inert literal. Also defines the previously-missingCONDITION_SAFE_METHODS/CONDITION_SAFE_PROPSallowlists.sharedHelpers.condition.test.ts.Sync + branding
Notes
config/local.jsintentionally left as a sanitized template (not modified).