Skip to content

Update web app, restore Assent branding, and fix XSS/code-injection - #86

Merged
Eshani Mishra (emishra) merged 3 commits into
mainfrom
users/emishra/sept2026
Sep 8, 2026
Merged

Eshani Mishra (emishra) merged 3 commits into
mainfrom
users/emishra/sept2026

Conversation

@emishra

Copy link
Copy Markdown
Contributor

Summary

Syncs source/reactjs with the latest internal implementation and hardens two security-sensitive rendering paths.

Security fixes

  • CWE-79 (XSS) in ErrorView.tsx — each errorMessages array item is now sanitized via renderSafeMarkdown (markdown + sanitize-html allowlist) before dangerouslySetInnerHTML, matching the singular errorMessage path. Closes an unsanitized sink fed by bulk-approval Key/Value data and user-supplied upload filenames.
  • CWE-94 (code injection) in sharedHelpers.tsx — replaces new 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 via JSON.stringify so a value containing a quote stays an inert literal. Also defines the previously-missing CONDITION_SAFE_METHODS / CONDITION_SAFE_PROPS allowlists.
  • Regression tests added in sharedHelpers.condition.test.ts.

Sync + branding

  • Ports the latest React app sources from the internal implementation while scrubbing internal-only content (internal folder, tenant configs, internal references). Public config files remain sanitized templates.
  • READMEs: restores the public Assent project branding, the ASSENT acronym, the original product description, and the License / Contributing / Code of Conduct / Trademarks sections in the top-level reactjs README; rebrands nested READMEs from "Microsoft Approvals" to "Microsoft Assent" and to "Approvals Backend API".

Notes

  • No changes to deployed product UI/telemetry branding (MSApprovals) — documentation scope only.
  • config/local.js intentionally left as a sanitized template (not modified).

Eshani Mishra and others added 2 commits September 8, 2026 15:18
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>
Comment thread source/reactjs/src/Components/Admin/AdminPage.api.ts Fixed
Comment thread source/reactjs/src/Components/Admin/AdminPage.api.ts Fixed
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>
@emishra Eshani Mishra (emishra) changed the title Sync source/reactjs from internal repo, restore Assent branding, and fix XSS/code-injection Update web app, restore Assent branding, and fix XSS/code-injection Sep 8, 2026
@emishra
Eshani Mishra (emishra) merged commit fcef95f into main Sep 8, 2026
4 checks passed
@emishra
Eshani Mishra (emishra) deleted the users/emishra/sept2026 branch September 8, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants