Skip to content

CINT-3870 Modernize examples, upgrade to latest framework versions, remediate Angular CVEs - #51

Draft
chrishollman wants to merge 5 commits into
mainfrom
CINT-3870/review-fixes
Draft

CINT-3870 Modernize examples, upgrade to latest framework versions, remediate Angular CVEs#51
chrishollman wants to merge 5 commits into
mainfrom
CINT-3870/review-fixes

Conversation

@chrishollman

@chrishollman chrishollman commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

JIRA Ticket

https://arkoselabs.atlassian.net/browse/CINT-3870

Overview

Modernizes all Arkose example integrations, fixes the CINT-3870 callback race (api.js executing before window.setupEnforcement is registered), addresses multi-model review findings, and upgrades every example to the latest stable framework versions to remediate the Wiz-flagged Angular CVEs.

Change summary

CVE remediation (Wiz): CVE-2026-54266 / 54267 / 54268 affected @angular/core and @angular/common < 20.3.25. Angular is upgraded to 22.0.8; npm ls confirms both resolve to 22.0.8. Lockfiles are now committed so the CVE-free resolution is pinned and scannable.

Latest-version upgrades (all build/test-verified where possible):

  • Angular 19 → 22.0.8 — TypeScript 6.0, zone.js 0.16, rxjs 7.8; dropped unused @angular/platform-browser-dynamic; fixed NG5002 self-closing element. ng build PASS. Shipped app: 0 audit vulnerabilities.
  • React — React 19.2, Vite 8, and migrated off legacy react-router-dom to react-router 8.3.0 (the modern single-package import), which clears the entire react-router advisory chain. vite build PASS. 0 audit vulnerabilities.
  • Vue — Vue 3.5.40, vue-router 5, Vite 8. vite build PASS. 0 audit vulnerabilities.
  • React Native 0.79 → 0.86 — react 19.2, react-native-webview 14, @react-native/* 0.86, jest 29 (matching the official RN 0.86 template), TypeScript 5.9. Removed Flipper (deleted ReactNativeFlipper.java, cleaned MainApplication.java) and migrated the Android/iOS native scaffolding to the 0.86 template (Gradle 9, SDK 36, Flipper-free Podfile). tsc + jest PASS.
  • engines.node bumped to each toolchain's requirement.

Earlier changes retained: callback-race fix across all frameworks; unified string onError contract; identity-guarded window.setupEnforcement cleanup; Angular post-destroy guard + selector prop standardization; RN WebView originWhitelist scoped to https; android/local.properties untracked; server-side-verification / nonce / run() README notes.

Does this PR introduce a breaking change?

Not for end users. Component APIs changed for anyone who copied the pre-fix examples (Angular selectorIdselector; onError emits a string). React example now imports from react-router instead of react-router-dom.

How has this been tested?

  • React / Vue / Angular: npm install + production build all PASS; npm audit clean (0 vulns for React/Vue; Angular shipped app 0, its 3 remaining moderates are dev-only @angular/cli transitive tooling not in the bundle).
  • React Native: npx tsc --noEmit and npm test (jest) PASS. The native Android/iOS build was NOT run (no Android SDK / Xcode in this environment) — a maintainer must validate ./gradlew assembleDebug and pod install + iOS build on a dev machine. RN's remaining npm audit findings are dev/test-tooling (jest/babel → brace-expansion chain) inherent to the RN 0.86 template and absent from the shipped mobile bundle.
  • Reviewed via multi-model (composer-2.5, gpt-5.5) and multiple Sonnet persona reviews.

Related PRs (if applicable):

External related documentation (if applicable):

  • React Router v7+ package consolidation (import from react-router, not react-router-dom)

🤖 Generated with Claude Code

chrishollman and others added 3 commits May 27, 2026 14:46
Fix the setupEnforcement race condition (CINT-3870) where
window.setupEnforcement was assigned in an onload handler, causing
api.js to miss the callback and fall back to a 1-second retry on
~50% of traffic for affected customers.

CDN examples: fix cookie-clearing bug across 6 files, fix variable
name mismatches in Auth0 workers, add missing return in DX worker,
change 301 to 302 redirects, move private key from GET to POST body,
add async to script tags, ES6+ modernization, accessibility fixes.

Multi-key example: fix broken closing div tags, add DOCTYPE/viewport,
fix XSS risk (innerHTML to textContent), add origin validation on
postMessage, replace deprecated parcel-bundler with npx serve, add
error callbacks.

React example: migrate from Create React App to Vite, upgrade to
React 19 and react-router-dom v7, convert Arkose class component to
functional with hooks (forwardRef, useImperativeHandle, callbacksRef
pattern), fix setupEnforcement race condition.

Vue example: migrate from Vue 2 + Vue CLI to Vue 3 + Vite, rewrite
all components with Composition API and script setup, remove
window.myEnforcement global.

Angular example: migrate from Angular 13 to Angular 19 with standalone
components, signal-based inputs/outputs, inject(), viewChild(),
lazy-loaded routes, esbuild.

React Native example: update to RN 0.79 and React 19, add TypeScript,
create typed HTML builder, replace dead dependencies, fix JSON.parse
crash and invalid overflow style.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add script onerror handlers (React, Vue, Angular), remove dead code
(Angular resetting field, deprecated react-test-renderer), add res.ok
checks and try/catch in CDN fetch calls, fix multi-key start-iframe
script, clean up redundant script.type attributes, and update READMEs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix callback-race safety and cross-framework consistency in the modernized examples:

- Unify onError contract to emit the Arkose error code string across React/Vue/Angular
  (fixes Vue alert() showing "[object Object]"); align to real client-api payload shape
- Guard window.setupEnforcement cleanup with an identity check so overlapping
  mount/unmount cannot clobber another instance's callback (React, Angular)
- Angular: guard async onError against post-destroy emit; standardize inline prop to
  `selector` (full CSS selector) to match React/Vue; correct error/failed types
- React Native: define setupEnforcement before the async api.js tag; scope WebView
  originWhitelist to https; restore react-test-renderer so the jest test runs;
  drop the broken eslint lint script
- Untrack android/local.properties (committed dev SDK path) and fix nested gitignore glob
- Remove unused @angular/forms; add engines.node >= 18; document server-side
  verification / nonce / run() / retry behavior in READMEs

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@wiz-code-arkose-labs

wiz-code-arkose-labs Bot commented Jul 24, 2026

Copy link
Copy Markdown

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings -
Software Management Finding Software Management Findings -
Total -

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try the Wiz Code extension for VS Code, JetBrains, or Visual Studio.

…e Angular CVEs

Remediates the Wiz-flagged CVE-2026-54266/54267/54268 (@angular/core & @angular/common
< 20.3.25) and brings every example to the latest stable versions. Commits lockfiles for
reproducible, scannable, CVE-free dependency resolution.

- Angular 19 -> 22.0.8 (TypeScript 6.0, zone.js 0.16, rxjs 7.8; dropped unused
  @angular/platform-browser-dynamic). Fixes NG5002 self-closing element. ng build PASS;
  shipped app: 0 audit vulns; @angular/core & @angular/common resolve to 22.0.8.
- React: React 19.2, Vite 8, and migrated off legacy react-router-dom to react-router 8.3.0
  (modern single-package import), which clears the react-router advisory chain. build PASS;
  0 audit vulns.
- Vue 3.5.40, vue-router 5, Vite 8. build PASS; 0 audit vulns.
- React Native 0.79 -> 0.86 (react 19.2, react-native-webview 14, @react-native/* 0.86,
  jest 29 to match the RN 0.86 template, TypeScript 5.9). Removed Flipper (deleted
  ReactNativeFlipper.java, cleaned MainApplication.java), migrated Android/iOS native
  scaffolding to the 0.86 template (Gradle 9, SDK 36, Flipper-free Podfile). tsc + jest PASS.
- engines.node bumped to each toolchain's requirement; Angular README version updated.

Verification: React/Vue/Angular built; RN typechecked and unit-tested. The RN native
android/ios BUILD was not run (no Android SDK/Xcode in CI) and must be validated on a dev
machine. Remaining audit findings are dev/test-tooling only (Angular CLI's transitive MCP
sdk; RN's jest/babel chain) and are absent from the shipped bundles.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@chrishollman chrishollman changed the title CINT-3870 Modernize example integrations + address review findings CINT-3870 Modernize examples, upgrade to latest framework versions, remediate Angular CVEs Jul 28, 2026
…t tags

CAPI (api.js) should not be loaded asynchronously. Dynamically injected scripts are
force-async by default, so setting async=false explicitly is required (deleting the
line alone would leave them async).

- React/Vue/Angular wrappers: script.async = true -> false
- multi-key + Auth0/DX CDN workers: injected api.js scripts were force-async by default;
  added script.async = false
- React Native inline HTML + CDN client HTML (button/form takeover, akamai-proxy):
  removed the `async` attribute from the api.js <script> tag

No `defer` was present on any CAPI script. The akamai-edgeworker inject uses parser-inserted
markup with no async attribute (already non-async), left unchanged. Web builds + RN typecheck pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant