Skip to content

Security: excelano/axe

SECURITY.md

Security Policy

Reporting a vulnerability

Please report suspected vulnerabilities privately, using the Report a vulnerability button on the Security tab of this repository. If that button is not there, or you would rather not go through GitHub, email david.anderson@excelano.com instead. I aim to respond within seven days.

Please do not open public issues for security problems.

Supported versions

The latest release receives security fixes. Older versions are not supported. A fix ships in a tagged release: a site picks it up by running its update-axe.sh, which copies the servable files into the site's axe/ directory, and redeploying, and the cleave package picks it up through apt.

What Axe can access

The viewer is client-side: view/index.html plus the vendored scripts. It has no server-side code, reads no filesystem, and fetches nothing it isn't pointed at; what it may fetch is set out under What the viewer fetches. Directory browsing is a separate tool, browse, which carries the only server-side surface and its own SECURITY.md. It is in a different GitHub organization (anderix, where this repository is excelano), so reviewing Axe does not review it; read its SECURITY.md before deploying it, deploy it only where you want directory listing, and confine it there.

cleave reads the document it is given and the Axe assets it inlines, and writes one HTML file.

What Axe stores

The theme toggle saves the chosen theme in the browser's localStorage under the key theme. Nothing else is stored, and nothing is sent anywhere.

Security model

The CSS framework itself (axe.css, calendar.css, default.css, theme.js) is static styling with no attack surface. The security model is about the viewer (view/) and the calendar component (calendar.js), because their job is to turn a document into live HTML in your site's origin.

Treat every document the viewer renders as if it were executable code. A .md, .csv, .ics, .toml, or .dclg file is markup, and markup that reaches the DOM can carry script. Axe defends against this wherever markup could enter, but the defenses are mitigation, not a license to render anything from anywhere:

  • Markdown is run through DOMPurify (dependencies/purify.min.js) before insertion, which strips <script>, onerror/onload and other event-handler attributes, and javascript: URLs. Do not remove this step or render Markdown with marked.parse() directly — marked does not sanitize. This holds for the slide-deck rendering too (?view=slides): each slide is one chunk of the same Markdown run through the same DOMPurify step, so presenting a .md carries no attack surface the document rendering does not.
  • Calendar event URLs (the URL: property of an .ics event) are passed through a scheme allowlist before becoming a link href. Only http:, https:, and mailto: survive; a javascript: URL is dropped and the event renders as plain text.
  • TOML links go through the same kind of scheme allowlist. A string becomes a link only when it is an http:/https:/mailto: URL, a bare email address, or a relative path ending in a document extension; any other scheme — javascript:, data: — is rejected outright rather than filtered, and the string renders as text. Relative paths resolve against the document's own URL, so a rendered file can only point within reach of where it already lives.

CSV and TSV cells are HTML-escaped on the way into the table, so a spreadsheet cannot inject markup. TOML needs no sanitizer for a different reason: toml.js yields data rather than markup, and the renderer builds every node with textContent, so a document never contributes HTML in the first place. DocLang is rendered the same way: the browser's DOMParser reads the XML into a tree, and the renderer builds HTML nodes from that tree with createElement and text nodes, so document text never reaches innerHTML. Its links go through the same scheme allowlist as TOML — <href> becomes a link only for http:/https:/mailto:, and a picture's <src> becomes an image only for those, data:image/, or a relative path resolved against the document — and an <xref> becomes an in-page anchor whose id is built from the thread number, not from document text. Note that an image URL is a request: a document can point an <img> at a third-party host, which the page's CSP (img-src 'self' data:) blocks unless you widen it.

What the viewer fetches

By default the viewer only reads files from its own origin. The ?url= parameter accepts a root-relative path (?url=reports/q1.md) and fetches it same-origin.

External URLs (?url=https://…) are denied by default. Rendering third-party content in your origin is a reflected-XSS vector — a crafted link would run someone else's markup as your site. To enable specific remote feeds, add their hostnames to the EXTERNAL_ALLOWLIST array near the top of the script block in view/index.html, and add the same hosts to the connect-src directive of the Content-Security-Policy. Only allowlist hosts whose content you trust as much as your own.

Baked (embedded) documents

A file produced by cli/cleave.py carries its document inlined in a hidden <textarea id="axe-embed"> and renders it instead of fetching. The document still passes through the same renderers and the same DOMPurify sanitization as the fetched path, so a baked file carries no attack surface the live viewer does not — the only difference is where the bytes come from. The document is escaped as RCDATA (& and <) so it cannot break out of the textarea, and because nothing is fetched, a baked file makes no network requests at all. Treat a baked .html as trustworthy only as the document and the brand CSS that went into it.

Operator responsibilities

A few things only the deployer can do, and Axe cannot enforce them for you:

  • Only point the viewer at documents whose authorship you trust. The built-in sanitization raises the bar but is not a substitute for controlling your inputs.
  • Serve the viewer over HTTPS.
  • For higher assurance, serve the viewer from a dedicated origin or subdomain, so that a sanitizer bypass cannot reach your main site's cookies or session.
  • The view/index.html page ships a defense-in-depth Content-Security-Policy in a <meta> tag. A header-based CSP is stronger: it can use a script nonce instead of 'unsafe-inline' and can set frame-ancestors (which <meta> cannot). Add one at the web-server level if your hosting allows it.
  • The calendar component trusts its source text completely. When you embed Calendar directly rather than through the viewer, the provenance of the iCalendar text is your responsibility.

There aren't any published security advisories