Bug#1099688: papers: AppArmor profile denies file lock on ~/.pki/nssdb, breaking signature certificate validation

Daniel Cordeiro dcordeiro at gmail.com
Mon Nov 23 11:31:40 GMT 2026


Package: papers
Version: 49.8-2
Followup-For: Bug #1099688
X-Debbugs-Cc: dcordeiro at gmail.com

Dear Maintainer,


I can confirm this bug is still present, and that it also breaks signature
*validation*, not only signing.

Versions (Debian testing):
apparmor 4.1.8-3+b1
libnss3 2:3.132-1
libpoppler-glib8t64 26.07.0-4
papers 49.8-2

Symptom: opening a signed PDF whose CA is installed and trusted in
~/.pki/nssdb, Papers shows "Signature is valid" but "Signed with a certificate
issued by unknown issuer", and prints "NSS_Init failed: security library: bad
database." The same file validated with poppler outside the confined
application succeeds:

  $ pdfsig -nssdir sql:$HOME/.pki/nssdb signed.pdf
  ...
  - Signature Validation: Signature is Valid.
  - Certificate Validation: Certificate is Trusted.

The kernel log shows the same denial as in the original report:

  apparmor="DENIED" operation="file_lock" class="file" profile="/usr/bin/papers"
  name="/home/<user>/.pki/nssdb/cert9.db" requested_mask="k" denied_mask="k"

strace confirms the sequence: poppler first tries the Firefox profile database
(open of cert9.db fails with EACCES, which is the "bad database" message), then
falls back to ~/.pki/nssdb. Reading ~/.pki/nssdb is already allowed by the
profile; only the file lock required by NSS's SQLite backend is denied, so the
fallback fails too.

Tested workaround: adding this single rule to
/etc/apparmor.d/local/usr.bin.papers and reloading the profile
(apparmor_parser -r /etc/apparmor.d/usr.bin.papers) fixes validation
completely:

  owner @{HOME}/.pki/nssdb/{cert9,key4}.db k,

I would suggest adding this rule to the shipped profile. I would *not* suggest
granting access to the Firefox profile directory instead: its key4.db protects
the browser's saved passwords, and the ~/.pki/nssdb fallback is sufficient.

Note: I only tested signature validation with a software-trusted CA. Signing
with a smart card, as in the original report, may need further rules (e.g. for
PKCS#11 modules loaded via pkcs11.txt / p11-kit), which I could not verify.

Context: the documents in my case were PDFs signed by the Brazilian
government signing service (gov.br), whose CA chain is not in the Mozilla
root store and must be added manually to the user's NSS database. This makes
the problem easy to hit for Brazilian users, but it applies to any CA
installed in ~/.pki/nssdb.


Regards,
Daniel


-- System Information:
Debian Release: forky/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 7.3.5+deb14-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=pt_BR.UTF-8, LC_CTYPE=pt_BR.UTF-8 (charmap=UTF-8), LANGUAGE=pt_BR:pt:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages papers depends on:
ii  dconf-gsettings-backend [gsettings-backend]  51.0-2
ii  gsettings-desktop-schemas                    51.0-2
ii  libadwaita-1-0                               1.10.0-2
ii  libc6                                        2.43-7
ii  libgcc-s1                                    16.2.0-4
ii  libgdk-pixbuf-2.0-0                          2.44.8+dfsg-1
ii  libglib2.0-0t64                              2.90.1-2
ii  libgraphene-1.0-0                            1.10.8-5+b2
ii  libgtk-4-1                                   4.24.1+ds-1
ii  libnautilus-extension4                       51.0.1-3
ii  libpango-1.0-0                               1.58.2-1
ii  libppsdocument-4.0-6                         49.8-2
ii  libppsview-4.0-5                             49.8-2
ii  papers-common                                49.8-2
ii  shared-mime-info                             2.4-5+b3

papers recommends no packages.

Versions of packages papers suggests:
ii  gvfs             1.62.0-3+b1
pn  nautilus-sendto  <none>
ii  poppler-data     0.4.12-1
ii  unrar            1:7.3.2-1

-- no debconf information



More information about the pkg-gnome-maintainers mailing list