Closed Bug 1864149 Opened 1 year ago Closed 1 year ago

TypeError: can't access property "handleSMimeMessage" when selecting message with invalid S/MIME signature. This also stalls gloda indexing.

Categories

(MailNews Core :: Security: S/MIME, defect, P1)

Thunderbird 119
Desktop
All

Tracking

(thunderbird_esr115 unaffected, thunderbird120 wontfix, thunderbird121 wontfix, thunderbird122 affected)

RESOLVED FIXED
122 Branch
Tracking Status
thunderbird_esr115 --- unaffected
thunderbird120 --- wontfix
thunderbird121 --- wontfix
thunderbird122 --- affected

People

(Reporter: welpy-cw, Assigned: welpy-cw)

References

(Regression)

Details

(Keywords: regression, Whiteboard: [datalossy])

Attachments

(2 files)

When gloda didn't seem to be able to finish indexing a folder, I noticed the following error message in the console:

TypeError: can't access property "handleSMimeMessage", mimeSvc.mailChannel.smimeHeaderSink is null        pgpmimeHandler.jsm:242:5
    handleSmime chrome://openpgp/content/modules/pgpmimeHandler.jsm:242
    onStartRequest chrome://openpgp/content/modules/pgpmimeHandler.jsm:195

Apparently a message with an invalid signature is the cause, just selecting it throws the same error. Excerpts from this message:

Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; 
	boundary="----=_Part_3096197_2000219346.1400078607082"
------=_Part_3096197_2000219346.1400078607082
Content-Type: application/pkcs7-signature; name=smime.p7s; smime-type=signed-data
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature
Assignee: nobody → h.w.forms
Status: NEW → ASSIGNED

Could you please forward me a message for which you see this happen?
(Please use file, save as, which gives you an .eml file, then zip it and please send the zip to me by email.)

Could you please update the patch?
The file you changed was moved to a different filename:
mail/extensions/openpgp/PgpMimeHandler.sys.mjs

(renamed in bug 1865550)

See Also: → 1869247
Severity: -- → S3
Priority: -- → P2

I suggest this is a high priority, because it breaks indexing.

I feel like this must be a regression, no? I ask partly because finding messages is a key part of my work and I'd like to go back to the version which didn't have the bug.

Also noteworthy, mine is currently stuck indexing Sent, but finding the message will be difficult because with bug 1823024 I don't know which account.

Severity: S3 → S2
Flags: needinfo?(mkmelin+mozilla)
OS: Unspecified → All
Priority: P2 → P1
Whiteboard: [datalossy]

Using nightly builds and https://mozilla.github.io/mozregression/ the regression range can be found.

Regressed by bug 1852922, I think all betas since 119.0b1 are affected.

Maybe we can fast-track adding that missing question mark to have this fixed in 122.0b1.

I accepted the patch.
I had not noticed that you had updated it, sorry for the delay.

Target Milestone: --- → 122 Branch

This will be fixed on beta by the merge on Monday.

Flags: needinfo?(mkmelin+mozilla)
Target Milestone: 122 Branch → ---
Version: Thunderbird 121 → Thunderbird 119
Target Milestone: --- → 122 Branch

Hartmut sent me an example message.

I don't get the exception with that message.

I still cannot reproduce the bug.

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/111f9aee5848
Prevent TypeError when handling S/MIME messages. r=kaie

Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED

(In reply to Kai Engert (:KaiE:) from comment #11)

I don't get the exception with that message.

When I open that .eml file and copy the message into an empty local folder, error console shows

console.error: gloda.datastore: "got error in _asyncTrackerListener.handleError(): 19: constraint failed"

After restarting or switching indexing off and on in the folder's properties I get

JavaScript error: resource:///modules/PgpMimeHandler.sys.mjs, line 224: TypeError: can't access property "handleSMimeMessage", mimeSvc.mailChannel.smimeHeaderSink is null
The MsgHdrToMimeMessage callback threw an exception: TypeError: can't access property "parts", aPart is null
JavaScript error: resource:///modules/gloda/MimeMessage.jsm, line 153: TypeError: can't access property "parts", aPart is null
Duplicate of this bug: 1869247
See Also: 1869247

Ok, with a fresh profile, and having the message already in an IMAP folder, I can reproduce the error that you're patching.

I don't get the other errors from comment 13.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: