Incorrect date-time format used in WebDAV: RFC 1123 instead of RFC 2616 #2927
Unanswered
Opisek
asked this question in
Issue Triage
Replies: 1 comment
-
|
Thank you very much @Opisek for raising this. I was the OP of the bug in Luna which turns out not to be a bug, just a strict standards follow by the Go stdlib. In case it's relevant, my installation details are; Stalwart EE 0.15.5 Happy to provide any trace logs or other details if they would be helpful. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Issue Description
Stalwart includes non-standard-compliant timestamps in its WebDAV properties.
I first encountered the bug when it was reported to me that the value
Mon, 9 Feb 2026 21:37:40 GMTwas supplied to my application via Stalwart's CalDAV implementation, which throws an error on my side.The
getlastmodifiedproperty in WebDAV is standardized in RFC 4918 15.7 to be the RFC 2616 3.3.1 format. This is the same as RFC 1123 5.2.14 with the crucial constraint that the date be a fixed-length subset of the RFC 1123 format. This is then formalized using ABNF as follows:The relevant part is
date1, which explicitly states that the day value be given using two digits. Naming these non-terminals "rfc1123-date" is misleading, but not formally incorrect. This is what "rfc1123-date" in RFC 4918 15.7 refers to, which I believe is where the issue originated. If one were to use the original RFC 1123 5.2.14 (which is equivalent to RFC 822 5.1 apart from allowing for more than two digits to be used for the year), one would obtain the following language:The important part is
date = 1*2DIGIT month 2*4DIGIT, which—as per RFC 5234—means that the day and year can use a variable amount of digits. Again, this is not what the WebDAV specification says.Expected Behavior
The RFC 2616 3.3.1 date-time format is used in WebDAV properties.
Actual Behavior
The RFC 1123 3.3.1 date-time format is used in WebDAV properties.
Reproduction Steps
Relevant Log Output
Stalwart Version
v0.15.x
Installation Method
Docker
Database Backend
RocksDB
Blob Storage
RocksDB
Search Engine
Internal
Directory Backend
Internal
Additional Context
I don't have the deployment details of the original issue report's Stalwart setup, but I found the culprit in the source code of Stalwart.
WebDavProperty::GetLastModifiedusesRfc1123DateTime: PermalinkRfc1123DateTimeuses a variable amount of digits for the day: PermalinkI'm tagging the person who reported the issue to me in case you still need some details about their Stalwart setup @hadleyrich
I acknowledge that:
traceand included relevant log output if applicable.Beta Was this translation helpful? Give feedback.
All reactions