integrity:check-core reports FILE_MISSING for the mimetypelist.js test fixture in QA builds

Aperta Adatta ai principianti
#41,769 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
php
Ambito
security

Direzione di ricerca

Inizia in lib/private/IntegrityCheck/Iterator/ExcludeFileByNameFilterIterator.php, nel pattern di esclusione intorno alla riga 66, quindi riproduci il problema con occ integrity:check-core sulla build complete-qa pubblicata. Confronta i percorsi esclusi dal verificatore con il comportamento del firmatario descritto nell’issue. Il lavoro è completato quando server-root/mimetypelist.js rimane escluso, mentre il fixture integritycheck di tests/data viene firmato e verificato e non viene più segnalato come FILE_MISSING.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

occ integrity:check-core reports FILE_MISSING on the QA variants only
(owncloud-11.0.0-qa, owncloud-complete-20260730-qa) for:

tests/data/integritycheck/app/core/js/mimetypelist.js
  expected: 27c74670adb750...830763fd
  current:

Non-QA variants are INTACT — they ship no tests/ directory, so the path
never exists.

Root cause: signer/verifier exclusion asymmetry

ExcludeFileByNameFilterIterator excludes by a path-suffix regex
(lib/private/IntegrityCheck/Iterator/ExcludeFileByNameFilterIterator.php:66):

private $excludedFilePathPatterns = [
    '|/core/js/mimetypelist.js$|', // regenerable via occ maintenance:mimetype:update-js
];

That regex is meant to exempt the one regenerable file at the server root, but
$ -anchored suffix matching also hits the integritycheck test fixture:

/srv/owncloud/tests/data/integritycheck/app/core/js/mimetypelist.js   match=1
/srv/owncloud/core/js/mimetypelist.js                                 match=1

The signer (ocsign) excludes the exact path core/js/mimetypelist.js, so it
signs the fixture and omits the real one. Verified in the published
v11.0.0 complete-qa manifest:

  • core/js/mimetypelist.js in manifest: false
  • tests/data/integritycheck/app/core/js/mimetypelist.js in manifest: true

So the verifier skips on disk exactly the file the signer put in the manifest →
FILE_MISSING.

Impact

Cosmetic-but-loud for QA builds: hasPassedCheck() treats FILE_MISSING as a
failure, so QA installs show a code-integrity warning. No cryptographic issue —
the envelope itself verifies: all 57 scopes in the published v11.0.0
complete-qa tarball pass ECDSA-P384/SHA-384 over the verbatim hashes bytes,
leaf CN == scope id, chain to root-g2, and 0 manifest-vs-disk diffs on a
pristine extraction.

Not a 11.0.0 regression — v11.0.0-rc3's complete-qa tarball reproduces it
identically, and the exclusion has been in place since 0f29535218.

Suggested fix

Align the two sides. Either anchor the verifier pattern to the server root so it
matches only the real file, e.g.

'|^' . preg_quote($root, '|') . '/core/js/mimetypelist\.js$|'

(the iterator already receives $root), or have the signer apply the same
suffix rule. Anchoring the verifier is the narrower change and keeps the fixture
signed and checked.

Reproduce

gh release download v11.0.0 --repo owncloud/core -p 'owncloud-complete-20260730-qa.tar.bz2'
tar xjf owncloud-complete-20260730-qa.tar.bz2
# install, then:
occ integrity:check-core
Lingua principale
PHP
Stelle
8.8k
Fork
2.1k
Merge medio
19h 32m
PR unite (30g)
56

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di owncloud/core

Tutte le issue di owncloud/core

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.