From 774e80ab321e3cdebf2daf4803d380d396f5bbb0 Mon Sep 17 00:00:00 2001 From: mdecimus Date: Sun, 1 Jun 2025 17:55:20 +0200 Subject: [PATCH] Strict vCard parsing (#1607) --- Cargo.lock | 4 ++-- crates/common/Cargo.toml | 2 +- crates/dav-proto/Cargo.toml | 4 ++-- crates/dav/Cargo.toml | 2 +- crates/dav/src/card/update.rs | 2 +- crates/groupware/Cargo.toml | 2 +- tests/Cargo.toml | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e81c0d24..f41d046c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -989,9 +989,9 @@ dependencies = [ [[package]] name = "calcard" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e16f081c4da49b29187103679784b4dcf2fbda52e9b519388c397cb58414e5a" +checksum = "c6387223a016027ad73f3482d6e58f804d22edcc8bff1a31df877094850621a6" dependencies = [ "ahash", "chrono", diff --git a/crates/common/Cargo.toml b/crates/common/Cargo.toml index 479767d9..ee7cc8c9 100644 --- a/crates/common/Cargo.toml +++ b/crates/common/Cargo.toml @@ -19,7 +19,7 @@ mail-auth = { version = "0.7" } mail-send = { version = "0.5", default-features = false, features = ["cram-md5", "ring", "tls12"] } smtp-proto = { version = "0.1", features = ["rkyv"] } dns-update = { version = "0.1" } -calcard = { version = "0.1.1", features = ["rkyv"] } +calcard = { version = "0.1.2", features = ["rkyv"] } ahash = { version = "0.8.2", features = ["serde"] } parking_lot = "0.12.1" regex = "1.7.0" diff --git a/crates/dav-proto/Cargo.toml b/crates/dav-proto/Cargo.toml index 035d5c65..9b73fdbc 100644 --- a/crates/dav-proto/Cargo.toml +++ b/crates/dav-proto/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" trc = { path = "../trc" } hashify = "0.2.6" quick-xml = "0.37.2" -calcard = { version = "0.1.1", features = ["rkyv"] } +calcard = { version = "0.1.2", features = ["rkyv"] } mail-parser = { version = "0.11", features = ["full_encoding", "rkyv"] } hyper = "1.6.0" rkyv = { version = "0.8.10", features = ["little_endian"] } @@ -15,7 +15,7 @@ chrono = { version = "0.4.40", features = ["serde"], optional = true } compact_str = "0.9.0" [dev-dependencies] -calcard = { version = "0.1.1", features = ["serde", "rkyv"] } +calcard = { version = "0.1.2", features = ["serde", "rkyv"] } serde = { version = "1.0.217", features = ["derive"] } serde_json = "1.0.138" chrono = { version = "0.4.40", features = ["serde"] } diff --git a/crates/dav/Cargo.toml b/crates/dav/Cargo.toml index 9da4fb9f..b78b6e57 100644 --- a/crates/dav/Cargo.toml +++ b/crates/dav/Cargo.toml @@ -14,7 +14,7 @@ directory = { path = "../directory" } http_proto = { path = "../http-proto" } jmap_proto = { path = "../jmap-proto" } trc = { path = "../trc" } -calcard = { version = "0.1.1", features = ["rkyv"] } +calcard = { version = "0.1.2", features = ["rkyv"] } hashify = { version = "0.2" } hyper = { version = "1.0.1", features = ["server", "http1", "http2"] } percent-encoding = "2.3.1" diff --git a/crates/dav/src/card/update.rs b/crates/dav/src/card/update.rs index 1081193a..22416f4b 100644 --- a/crates/dav/src/card/update.rs +++ b/crates/dav/src/card/update.rs @@ -77,7 +77,7 @@ impl CardUpdateRequestHandler for Server { )) })?; - let vcard = match Parser::new(vcard_raw).entry() { + let vcard = match Parser::new(vcard_raw).strict().entry() { Entry::VCard(vcard) => vcard, _ => { return Err(DavError::Condition(DavErrorCondition::new( diff --git a/crates/groupware/Cargo.toml b/crates/groupware/Cargo.toml index 3d0afa4f..d4e8f9b2 100644 --- a/crates/groupware/Cargo.toml +++ b/crates/groupware/Cargo.toml @@ -12,7 +12,7 @@ jmap_proto = { path = "../jmap-proto" } trc = { path = "../trc" } directory = { path = "../directory" } dav-proto = { path = "../dav-proto" } -calcard = { version = "0.1.1", features = ["rkyv"] } +calcard = { version = "0.1.2", features = ["rkyv"] } hashify = "0.2" tokio = { version = "1.45", features = ["net", "macros"] } rkyv = { version = "0.8.10", features = ["little_endian"] } diff --git a/tests/Cargo.toml b/tests/Cargo.toml index abd635db..22c2a336 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -29,7 +29,7 @@ imap = { path = "../crates/imap", features = ["test_mode"] } imap_proto = { path = "../crates/imap-proto" } dav = { path = "../crates/dav", features = ["test_mode"] } dav-proto = { path = "../crates/dav-proto", features = ["test_mode"] } -calcard = { version = "0.1.1", features = ["rkyv"] } +calcard = { version = "0.1.2", features = ["rkyv"] } groupware = { path = "../crates/groupware", features = ["test_mode"] } http = { path = "../crates/http", features = ["test_mode", "enterprise"] } http_proto = { path = "../crates/http-proto" }