Skip to content
nexubDesign System
v11.9.0

Getting Started

Security

What the library guards for you, and what stays your job.

Secure by default

Components that render values you don't control (user input, CMS content, LLM output) guard them before they reach the DOM. The guards are exported, so your own components can use the same rules.

TSX
import { safeHref, safeSrc } from '@nexub/react';

safeHref('javascript:alert(1)');    // undefined
safeHref('/settings');              // '/settings'
safeHref('slack://open');           // allowed in 7.x
safeHref(url, { strict: true });    // web, mailto, tel and sms only (the 8.0 default)
safeSrc('data:image/png;base64,…'); // allowed: an <img> can't run script

Threat model by component

Every component that renders a URL, a file, or text from a user, a CMS or a model. Since 9.6 an XSS corpus (15 hostile URLs, 10 markup and template payloads) runs against each of these props in @nexub/react, @nexub/patterns and @nexub/marketing, with menus opened first. After each render the DOM is audited: no injected element, no event-handler attribute, no link outside http(s), mailto, tel and sms, and no source outside http(s), blob and data:image/.

ComponentRiskWhat Nexub does
Breadcrumb, MediaCard, CardLink, Avatar, pattern and marketing navsA javascript:, vbscript:, data: or file: URL from a user, CMS or LLM runs script when clicked.Every href goes through safeHref and every image src through safeSrc. A blocked value renders no link, or the fallback.
Citation, SourceChip, SourceListModel-generated source URLs and favicons.safeUrl: absolute http(s) only.
Dialog, AlertDialog, Sheet, CommandPalette, menus, SelectRadix injects a <style> for scroll lock, which a strict CSP blocks.scrollLock="class", or a NexubProvider nonce. See Strict CSP.
ThemeScriptStored theme values come from localStorage, which any script on the origin can write.Only known theme, contrast, glass and product values are applied. The script is escaped and takes a nonce.
PasswordInputA revealed password reaching cloud spellcheck or autocorrect.Spellcheck, autocorrect and autocapitalize are always off. autoComplete defaults to current-password.
FileUploadaccept, maxSize and validate run in the browser and can be bypassed. A file name is attacker text.Use them for feedback only. Check type (magic bytes), size and content again on the server. Names render as text; only images get a preview, from a blob: URL.
MessageBubble, StreamingText, ChatPage, CodeModel output or user messages that contain markup, a script or a markdown javascript: link.Everything is rendered as text. No component parses HTML or markdown, and none uses dangerouslySetInnerHTML.
DataTable CSV export (toCSV)A cell that starts with =, +, - or @ runs as a formula when the file is opened in a spreadsheet.Such cells get a leading apostrophe; quotes, commas and line breaks are escaped (RFC 4180).
Chart, StatCard, Amount, MoneyInput, NumberInputNumbers and labels from an API: NaN, Infinity, huge or non-Latin-digit values.Labels render as text. The inputs only report finite numbers inside their bounds (property-tested).
Link, Button asChild, Breadcrumb.Link, NavigationMenu.LinkThese are primitives: your href goes to the DOM as you wrote it.Pass safeHref(url) when the value is not yours. React itself blocks javascript: URLs. The data-driven APIs (Breadcrumb.Trail, navs, cards) guard for you.

Content-Security-Policy

Nexub works without 'unsafe-inline' scripts and, with a nonce or scrollLock="class", without inline style elements. Strict CSP has the per-component details.

This site runs that way. Its script policy is a per-request nonce with 'strict-dynamic' and nothing else, and Trusted Types is enforced: a string can't reach innerHTML, script.src or eval. A test loads every page of the site under the production policy and fails on any violation, which is also the proof that the library needs no inline script and makes no Trusted Types violation. Two exceptions remain, and neither can run script: style-src-attr 'unsafe-inline' for server-rendered style attributes, and the React Native web preview under /m, whose runtime injects its own style elements.

Resilience

Since 9.5, the code that reads what a person or a model hands it is tested with generated input, not only examples. Property-based tests (fast-check) cover parseMoney in eight locales, safeHref and safeSrc against schemes hidden with tabs, newlines, control characters and mixed case, seed colours, CSV export, and typed entry in NumberInput, OTPInput, MoneyInput and DatePicker.

CheckWhat it doesWhen
Property testsRandom input for every parser and typed field. A counterexample fails the build with the seed to replay it.Every PR
Leak testMounts and unmounts every story 1,000 times. Listeners, timers, DOM nodes and heap must not grow.Every PR
Docs soakOne browser session of navigation, search and theme switches: no error, no reload, flat memory.1 minute per PR, 30 minutes nightly
Mobile soakOne iOS app session of screens, toasts, dialogs and sheets: no crash, flat memory.30 minutes nightly

The page templates (PageFrame and every page built on it) and React Native's ScreenContainer catch a render error in their content. The header and navigation stay up and the content shows “Something went wrong” with Retry. Pass onError to report it and errorFallback to draw your own.

TSX
<DashboardPage
  title="Home"
  onError={(error, info) => Sentry.captureException(error, { extra: info })}
  errorFallback={({ reset }) => <MyError onRetry={reset} />}
  {...data}
/>

Supply chain

Since 9.7 every release can be traced to the commit and workflow that built it. The tarballs are built, packed and attested in an isolated workflow (SLSA Build Level 3), and the publish job uploads those exact files. Two builds of one commit give byte-identical tarballs, which CI checks on every pull request.

Terminal
# Is this tarball the one Nexub's release workflow built?
npm pack @nexub/react@9.7.0
gh attestation verify nexub-react-9.7.0.tgz --repo Nexub-AI/nexub-ds \
  --signer-workflow Nexub-AI/nexub-ds/.github/workflows/build-release.yml
ControlWhat it means
Trusted publishingnpm accepts a release only from the release workflow. No npm token exists to steal.
Build provenanceA signed statement of which commit and workflow produced each tarball, on npm and on the GitHub release.
Signed release tagEach release has a tag v<version> signed with Sigstore by the release workflow.
SBOMAn SPDX list of every dependency, attached to each GitHub release.
Dependency policyEvery runtime dependency is listed with its reason. New releases of a dependency wait 7 days before they can be installed.
GatesNo open CodeQL alert of high or critical severity. An OpenSSF Scorecard minimum that only goes up.

Security review

Before 9.8 we reviewed everything Nexub ships or runs (the packages, this site, its feedback endpoint, the MCP server and the release pipeline) against a written checklist: OWASP ASVS Level 2, where a chapter applies. It was an internal review, not an outside audit. It found nothing critical or high. Every finding and what was done about it is in SECURITY_REVIEW.md.

CheckedResult
Critical or high findingsNone
Medium and low findings13 found: 12 fixed in 9.8.0, 1 closed as not a defect
Advisories in dependenciesNo high or critical advisory in any dependency, dev tools included. Blocking on every pull request
Next reviewBefore every major version, and after any change to the feedback endpoint, the middleware or the release workflows

Reporting a vulnerability

Report privately: open a private advisory on GitHub, or email security_report@nexub.com. Please don't use a public issue.

SeverityWe acknowledge withinFix on npm within
Critical1 working day24 hours of confirming it
High3 working days7 days
Medium, low3 working days30 days

Fixes ship on the latest version only, as a patch, and don't wait for the next scheduled release. There are no maintenance branches, so stay on the latest version. Each fix comes with a GitHub Security Advisory that names the affected and fixed versions, and a CVE for high and critical issues. The steps we follow are in the incident runbook.