Skip to content

fix: make the vendored Ace editor auditable - #446

Merged
oc-tmueller merged 1 commit into
masterfrom
fix/document-vendored-ace
Sep 9, 2026
Merged

oc-tmueller merged 1 commit into
masterfrom
fix/document-vendored-ace

Conversation

@oc-tmueller

Copy link
Copy Markdown
Contributor

Dependency audit for this app, a precondition for the re-release tracked in owncloud/core#41824.

What I found

js/vendor/ace/ holds a curated subset of Ace's src-noconflict build — 149 files, committed by hand. There is no dependency manifest of any kind: no bower, no npm, nothing. So nothing has ever watched the version, and no scanner could list Ace among the libraries this app ships. The only way to learn the version was to grep exports.version out of ace.js.

It is 1.2.6, released in 2016.

Audit result: clean, and the version string is trustworthy

No advisories. Checked the GitHub Advisory Database under ace, ace-builds and brace — no advisories exist for any version of Ace, so none apply to 1.2.6. Ace bundles no further libraries, so there is no transitive surface.

Unmodified upstream — verified, not assumed. I fetched [email protected] from the npm registry and compared SHA-256 digests. All 12 files checked are byte-identical to upstream: ace.js, ext-searchbox.js, ext-modelist.js, theme-clouds.js, mode-{php,javascript,markdown,python,json,yaml}.js, and both keybindings.

That matters because it is the opposite of the files_pdfviewer case in the same audit, where the vendored pdf.js reports 2.10.0 but carries a local CVE backport. Here the version string can be taken at face value.

I have been explicit in PATCHES.md that this is not a clean bill of health: 1.2.6 is from 2016, "no published advisory" is not "audited", and this app hands the editor untrusted file content. The upgrade is worth doing on its own merits — just not inside a patch release.

Changes

  • js/vendor/ace/PATCHES.md — version, curation, provenance commits, the digest verification, the advisory audit, and how to update.
  • js/vendor/ace/package.json — a version marker so scanners and SBOM tooling can inventory Ace. No .trivyignore is needed here, unlike the pdf.js case, because there is no advisory to suppress.
  • .gitignore — anchor the composer rule to /vendor/.

The gitignore fix is worth a look

The composer rule was vendor/, unanchored, so it also matched js/vendor/ and ignored that directory outright. Two consequences:

  1. New files there needed git add -f.
  2. The curation rules below it were dead. Lines like /js/vendor/ace/src-noconflict/theme-* with !.../theme-clouds.js re-includes could never take effect, because git does not descend into an ignored directory.

Verified after the change: root vendor/ is still ignored; worker-php.js, theme-monokai.js and ext-emmet.js under src-noconflict are now genuinely excluded, while the three whitelisted files stay visible; and git status exposes nothing beyond the two files this PR adds.

Not in this PR

The version bump to 2.7.2 is separate, so this can be reviewed on its merits and the release timed independently. The Ace upgrade is deferred and worth tracking on its own — the module layout and several extension APIs changed since 1.2.6, and it needs the editor exercised by hand.

🤖 Generated with Claude Code

js/vendor/ace holds a curated subset of Ace's src-noconflict build, 149
files committed by hand. There is no manifest of any kind - no bower, no
npm - so nothing has ever watched the version, and no scanner could list
Ace among the libraries this app ships.

Add js/vendor/ace/PATCHES.md recording the version (1.2.6), the curation
(worker-*, most themes and extensions are excluded by .gitignore, so
syntax checking runs in the main thread by design), the provenance
commits, and the advisory audit: no advisories exist for Ace under `ace`,
`ace-builds` or `brace`, so none apply.

It also records that no patches have been applied, verified rather than
assumed: [email protected] was fetched from the npm registry and compared
by SHA-256. All 12 files checked - ace.js, ext-searchbox.js,
ext-modelist.js, theme-clouds.js, six mode-*.js and both keybindings -
are byte-identical to upstream. So unlike the vendored pdf.js in
files_pdfviewer, this version string can be trusted at face value.

The file is explicit that 1.2.6 dates from 2016 and that "no published
advisory" is not "audited", given the editor is handed untrusted file
content. The upgrade is tracked separately; it needs the editor exercised
by hand and does not belong in a patch release.

Add js/vendor/ace/package.json as a version marker so scanners and SBOM
tooling can inventory the library. Unlike the pdf.js case this needs no
.trivyignore, because there is no advisory to suppress.

Anchor the composer `vendor/` gitignore rule to the project root. Left
unanchored it also matched js/vendor/, which ignored that directory
outright - so the /js/vendor/ace/... curation rules below it could never
take effect, since git does not descend into an ignored directory.
Verified: root vendor/ stays ignored, and worker-*, theme-* and ext-*
under src-noconflict are now genuinely excluded while the three
whitelisted files remain visible.

Refs: owncloud/core#41824

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@oc-tmueller
oc-tmueller requested a review from a team as a code owner September 9, 2026 12:39
@CLAassistant

CLAassistant commented Sep 9, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@oc-tmueller
oc-tmueller merged commit f2913f9 into master Sep 9, 2026
15 checks passed
@oc-tmueller
oc-tmueller deleted the fix/document-vendored-ace branch September 9, 2026 13:09
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.

3 participants