Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing or downloading a PGP public key attachment from a PGP encrypted message doesn't work #1500

Closed
mindsolve opened this issue Mar 15, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@mindsolve
Copy link

Describe the bug
When trying to open or download a PGP public key (with .asc ending) from within a decrypted PGP message, nothing happens in the UI (it silently fails to download or open).
In the browser console, a Content-Security-Policy error is logged regarding accessing a "data:application/pgp-keys;[...]" URL (see below).

To Reproduce
Steps to reproduce the behavior:

  1. Receive a PGP-encrypted e-mail, with a public PGP key as attachment
  2. Open and decrypt the message
  3. Click on the attachment
  4. Observe nothing in the UI to happen

Expected behavior
I would expect either the "Import PGP key" dialog to open (as it does with a non-encrypted message with a .asc/PGP public key attached), or otherwise to simply download the file.

Screenshots
I don't think a screenshot would add any information here

Please complete the following information:

  • Browser: Firefox 123.0.1
  • IMAP daemon: dovecot
  • PHP version: 8.1.2-1ubuntu2.14
  • SnappyMail Version: 2.35.3
  • Mode: standalone

Debug/logging information
Snappymail Debug Log (only lines were written during opening the message, none were written during decryption or attempted attachment download)
snappymail-debug-pgp-attachment-download.log

Browser Console Log:
(note: translation for the german first log line is: Content-Security-Policy: The page settings have blocked the loading of a resource on data:application/pgp-keys;base64,LS0tLS1... )

Content-Security-Policy: Die Einstellungen der Seite haben das Laden einer Ressource auf data:application/pgp-keys;base64,LS0tLS1… blockiert ("connect-src"). snappy.felix-ern.de:13:121114

Uncaught (in promise) TypeError: NetworkError when attempting to fetch resource.
    fetch https://snappy.felix-ern.de/#/mailbox/INBOX:13
    Vr https://snappy.felix-ern.de/snappymail/v/2.35.3/static/js/min/app.min.js:1
    onBuild https://snappy.felix-ern.de/snappymail/v/2.35.3/static/js/min/app.min.js:1
    onBuild https://snappy.felix-ern.de/snappymail/v/2.35.3/static/js/min/app.min.js:1
    Ss https://snappy.felix-ern.de/snappymail/v/2.35.3/static/js/min/app.min.js:1
    ks https://snappy.felix-ern.de/snappymail/v/2.35.3/static/js/min/app.min.js:1
    ks https://snappy.felix-ern.de/snappymail/v/2.35.3/static/js/min/app.min.js:1
    parse https://snappy.felix-ern.de/snappymail/v/2.35.3/static/js/min/libs.min.js:1
    l https://snappy.felix-ern.de/snappymail/v/2.35.3/static/js/min/libs.min.js:1
    l https://snappy.felix-ern.de/snappymail/v/2.35.3/static/js/min/libs.min.js:1
    init https://snappy.felix-ern.de/snappymail/v/2.35.3/static/js/min/libs.min.js:1
    Ms https://snappy.felix-ern.de/snappymail/v/2.35.3/static/js/min/app.min.js:1
    start https://snappy.felix-ern.de/snappymail/v/2.35.3/static/js/min/app.min.js:1
    Gi https://snappy.felix-ern.de/snappymail/v/2.35.3/static/js/min/app.min.js:1
    promise callback*Gi https://snappy.felix-ern.de/snappymail/v/2.35.3/static/js/min/app.min.js:1
    start https://snappy.felix-ern.de/snappymail/v/2.35.3/static/js/min/app.min.js:1
    bootstart https://snappy.felix-ern.de/snappymail/v/2.35.3/static/js/min/app.min.js:1
    bootstart https://snappy.felix-ern.de/snappymail/v/2.35.3/static/js/min/app.min.js:1
    c https://snappy.felix-ern.de/#/mailbox/INBOX:13
    <anonymous> https://snappy.felix-ern.de/#/mailbox/INBOX:13
    promise callback* https://snappy.felix-ern.de/#/mailbox/INBOX:13
    promise callback* https://snappy.felix-ern.de/#/mailbox/INBOX:13
    <anonymous> https://snappy.felix-ern.de/#/mailbox/INBOX:13
snappy.felix-ern.de:13:121114

Additional context
Add any other context about the problem here.

@the-djmaze the-djmaze added the bug Something isn't working label Mar 15, 2024
@the-djmaze
Copy link
Owner

It's not only PGP decrypted messages.
It failed for any message that is parsed in JavaScript.

@mindsolve
Copy link
Author

Thanks a lot! It now works exactly as expected 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants