Skip to content

Security Notes — Year Planner for React ​

Scope: RD-06 rendering/styles/slots, RD-07 pointer/selection input, RD-08 command diagnostics and the RD-10 security, privacy and dependency gates Status: Complete for R1 — automated security suite, CSP, audit and license report

Trust boundary ​

InputTrustHandling
items, layers, groups, resourcesHost data; may be untrustedValidated and normalized before render
Item style / className / color / textColorHost presentation inputCSS allowlist for style properties; color fields accept only hex/rgb/hsl/named/var(--yp-*) values; url(), expression(), @import, javascript: dropped
metadataUntrustedNever read for HTML, CSS, URLs or text
getDateMeta return valuesHost presentation inputMerged into cell styles; same style and color allowlist
style, cssVars, theme tokensTrusted host configurationRendered as inline CSS variables/properties
Render slot contentHost React nodesRendered by React; no raw HTML path
Pointer coordinatesBrowser inputClamped to known cells; blank slots never invent dates
Host controls in cellsHost React nodesPointer, click and key events are ignored by the planner

Output safety ​

  • No dangerouslySetInnerHTML, eval, remote CSS imports or runtime CSS-in-JS.
  • React escapes text content.
  • Hidden items are excluded before fragments, slots, overflow and tooltip data.
  • Diagnostics carry entity IDs and generic messages; item titles, periods, instants and resource names are not included.
  • Command diagnostics render as text. Local diagnostics for hidden items keep the item ID but omit titles, dates and layer names. Host-supplied diagnostic prose is host-owned; redact sensitive text in the host before returning it.
  • A read-only or editable UI state is never proof of authorization. The host remains authoritative for every command.
  • Layer identity uses label, pattern and data-yp-layer attributes so color is not the only signal.
  • Hidden or filtered items are not hit-testable and are pruned from selection. Locked/read-only/timed items never start an edit gesture.
  • Drag previews are decorative, aria-hidden and never mutate canonical items before the validated command commits.

Content Security Policy ​

Themes and geometry use inline style attributes. A host needs:

text
style-src-attr 'unsafe-inline'

or an equivalent policy that permits style attributes for the planner root. Nonces do not authorize inline style attributes. If a host forbids style attributes, per-instance theming and scaled geometry are not supported in R1.

Recommended baseline:

text
default-src 'self';
script-src 'self';
style-src 'self' 'unsafe-inline';
style-src-attr 'unsafe-inline';
img-src 'self' data:;
connect-src 'self';

The Playwright suite loads the demo under this allowance and asserts the grid renders. Unit tests assert that metadata strings never appear as HTML or CSS and that unsafe item-style values are dropped.

RD-10 evidence ​

GateEvidence
Hidden datasecurity.spec.test.tsx proves a sentinel hidden by id, layer and group is absent from the DOM, ARIA, print tree, tooltip and item list; the E2E scan repeats it on the demo fixture
InjectionHostile titles, annotation labels, metadata, style values, class names and getDateMeta styles stay inert in the component and implementation tests
NetworkUnit spies on fetch, XMLHttpRequest, sendBeacon, WebSocket and EventSource record zero calls; the E2E request log rejects any cross-origin or unexpected same-origin request
CSPThe demo renders under the documented style-src-attr 'unsafe-inline' policy with no attacker request
Parser fuzz1,000 seeded malformed dates and periods return diagnostics and never throw (fuzz.spec.test.ts)
Dependency auditpnpm audit --audit-level high exits 0: no high or critical advisories. Two moderate, development-only advisories remain (glob, minimatch); both are transitive build-tool dependencies and are accepted until their parents update
LicensesTHIRD_PARTY_NOTICES.md is generated from the recursive pnpm -r licenses list and checked by pnpm test:licenses; the published library bundles no third-party runtime code, and the demo dependencies are covered in the development table
CI least privilegecontents: read, no secrets., no pull_request_target, no write-all, no committed tokens; asserted by audit-contract.spec.test.ts
ToolchainVitest and @vitest/coverage-v8 upgraded from 3.2.7 to 4.1.12, removing the two critical tinypool advisories

The manual NVDA/VoiceOver audit remains parked by user decision; no WCAG conformance claim is made.

Limitations ​

  • The host owns authentication, authorization, tenancy and persistence.
  • Hidden items are not rendered, but hidden data still exists in the host's JavaScript state; this component is not a confidentiality boundary.
  • Full CSP, dependency and penetration testing is part of RD-10.

Free for internal use. Built with VitePress, Storybook and TypeDoc.