Skip to content

fix(deps): clear the two RustSec advisories failing cargo-deny - #3264

Merged
inureyes merged 1 commit into
mainfrom
fix/rustsec-2026-advisories
Nov 22, 2026
Merged

inureyes merged 1 commit into
mainfrom
fix/rustsec-2026-advisories

Conversation

@inureyes

Copy link
Copy Markdown
Member

cargo-deny started failing on every branch after two advisories were published on 2026-11-22. RUSTSEC-2026-0592 is a stack overflow in url 2.5.8 Url::origin() on nested blob: URLs, reached through reqwest and tower-http; url moves to 2.5.9 (and form_urlencoded to 1.2.3), the fixed release. RUSTSEC-2026-0543 declares chrono, a direct dependency, unmaintained with no safe upgrade; it is an unmaintained notice rather than a vulnerability, so it is ignored in deny.toml with a reason until the call sites move to time.

cargo deny check advisories passes locally.

cargo-deny started failing on every branch after two advisories were published on 2026-11-22. RUSTSEC-2026-0592 is a stack overflow in `url` 2.5.8 `Url::origin()` on nested `blob:` URLs, reached through reqwest and tower-http; `url` moves to 2.5.9 (and `form_urlencoded` to 1.2.3), the fixed release. RUSTSEC-2026-0543 declares `chrono`, a direct dependency, unmaintained with no safe upgrade; it is an unmaintained notice rather than a vulnerability, so it is ignored in `deny.toml` with a reason until the call sites move to `time`.

`cargo deny check advisories` passes locally.
@inureyes inureyes added type:bug Bug fixes, error corrections, or issue resolutions status:review Under review priority:high High priority labels Nov 22, 2026
@inureyes

Copy link
Copy Markdown
Member Author

The RUSTSEC-2026-0543 ignore added here is tracked for removal in #3266.

@inureyes
inureyes merged commit 29a3987 into main Nov 22, 2026
33 checks passed
@inureyes
inureyes deleted the fix/rustsec-2026-advisories branch November 22, 2026 21:29
inureyes added a commit that referenced this pull request Nov 27, 2026
* update(deps): replace the unmaintained chrono crate with time

RUSTSEC-2026-0543 declares `chrono` unmaintained with no safe upgrade, and
#3264 only recorded it as an ignore in `deny.toml`. Every direct use was a
`chrono::Utc::now()` call under `src/server`: 45 sites in 23 files, in seven
shapes. They now call `src/server/clock.rs`, which takes Unix values from
`std::time` and calendar fields from `time::OffsetDateTime`, and spells out
each string so it matches what chrono produced:

- `timestamp()`, `timestamp_millis()`, `timestamp_micros()`: Unix seconds,
  milliseconds and microseconds, rounded toward the past. These feed
  `created`, `created_at`, `completed_at` and `started_at_unix`, the
  `srv_{pid}_{millis}` instance id, per-model `last_used`, and `req_{micros}`
  request ids.
- `timestamp_nanos_opt().unwrap_or_default()`: Unix nanoseconds, or 0
  outside the i64 range. Used in router-cache staging and quarantine
  directory names.
- `to_rfc3339_opts(SecondsFormat::Secs, true)`: `2026-11-26T16:07:00Z`, for
  WebUI event `emitted_at` and lifecycle operation `created_at` and
  `updated_at`.
- `to_rfc3339()`: a `+00:00` offset and a fraction of 0, 3, 6 or 9 digits,
  for runtime snapshot `sampled_at` and `measured_at`.
- `format("%d %b %Y")`: `05 Mar 2026`, from the `strftime_now`
  chat-template function.

`clock_tests.rs` pins each shape at fixed instants. The instants include one
before the epoch, two outside the i64 nanosecond range, a leap day, a
three-digit year, and fractions that need 1 to 9 digits. The same file
passed against a copy of `clock.rs` built on main's chrono expressions and
against the new code. The two test-only `DateTime::parse_from_rfc3339`
checks now go through `clock::is_rfc3339`, which uses `time`'s RFC 3339
parser; `parsing` is enabled only in dev-dependencies.

Only the root crate depended on `chrono`, so Cargo.lock drops chrono,
iana-time-zone, iana-time-zone-haiku and android_system_properties.
`time` 0.3.55 was already locked through rcgen's dev-dependency path.
Release builds now also compile it, with `std` only, together with
deranged, num-conv, powerfmt and time-core. The RUSTSEC-2026-0543 ignore
is removed from `deny.toml`. Log line timestamps do not change, because
tracing-subscriber is built without its chrono feature.

Closes #3266

* update(deps): read calendar fields from jiff instead of time

The maintainer chose `jiff` over `time` as the `chrono` replacement, because time-zone calculations are expected later and `jiff` brings them behind its `tz` features. `jiff` 0.2 is added with `default-features = false, features = ["std"]`, so a release build compiles only `jiff` and `jiff-core` and no time zone database. `time` leaves `[dependencies]` and `[dev-dependencies]`; it stays in the lock through rcgen and yasna on the dev path.

`clock.rs` reads the UTC civil date and time from a `jiff::Timestamp` and still assembles every string with `format!`, so the pinned shapes are unchanged. `is_rfc3339` (test code only) checks the RFC 3339 shape before parsing with `jiff`, since `jiff` also accepts ISO 8601 and Temporal forms such as minutes without seconds, the basic format and bracketed annotations; the pinning test now rejects those.

Validated with fmt, clippy on `mlxcel`, `cargo deny check`, and the `server::clock` tests and the server filters the clock feeds.

Refs #3266, Refs #3462

---------

Co-authored-by: Jeongkyu Shin <[email protected]>
@inureyes inureyes added this to the 0.9 milestone Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:high High priority status:review Under review type:bug Bug fixes, error corrections, or issue resolutions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant