🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #5729

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

#5729
From: Daniel Cordeiro
Date: Mon, 23 Nov 2026 11:40
103 lines
5788 bytes
Package: papers
Version: 49.8-2
Followup-For: Bug #1099688
X-Debbugs-Cc: dcordeiro@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
Technical Details
Message-ID: <O2AyR-dEXa-1@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!news-fra.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
References: <LO1cl-aQNg-3@gated-at.bofh.it>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-fra.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Daniel Cordeiro <dcordeiro@gmail.com>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1099688: papers: AppArmor profile denies file lock on ~/.pki/nssdb, breaking signature certificate validation
Date: Mon, 23 Nov 2026 12:40:01 +0100
Message-ID: <O2AyR-dEXa-1@gated-at.bofh.it>
References: <LO1cl-aQNg-3@gated-at.bofh.it>
X-Original-To: Debian Bug Tracking System <1099688@bugs.debian.org>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Mon Nov 23 11:33:08 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: 2.767
Reply-To: Daniel Cordeiro <dcordeiro@gmail.com>, 1099688@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: dcordeiro@gmail.com, pkg-gnome-maintainers@lists.alioth.debian.org
X-Debian-Pr-Message: followup 1099688
X-Debian-Pr-Package: papers
X-Debian-Pr-Source: papers
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Mailer: reportbug 13.2.0+nmu1
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2004405
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 103
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Mon, 23 Nov 2026 08:31:40 -0300
X-Original-Message-ID: <179543350092.24804.4216569893479583645.reportbug@varzea>
X-Original-References: <a62556f368f72847068bf176fb9afc8deabb786c.camel@dia.uned.es>