Skip to content

fix: clear RUSTSEC-2026-0592 (url) and RUSTSEC-2026-0543 (chrono) - #136

Open
JonathanO wants to merge 6 commits into
mainfrom
fix/advisories-url-chrono
Open

JonathanO wants to merge 6 commits into
mainfrom
fix/advisories-url-chrono

Conversation

@JonathanO

Copy link
Copy Markdown
Owner

Summary

The weekly Advisories job fails on two new advisories. This PR fixes both.

  • RUSTSEC-2026-0592 (url 2.5.8, stack overflow in Url::origin()): update url to 2.5.9. This also updates form_urlencoded to 1.2.3.
  • RUSTSEC-2026-0543 (chrono is unmaintained, no fix): replace chrono with jiff::Timestamp. The serenity next branch also uses jiff, so the move to serenity 0.13 needs no second migration.
    • serenity's chrono feature is off. The other default features stay on. serenity's Timestamp then wraps time::OffsetDateTime, and message_time() converts it to jiff.
    • The range of jiff is about one day shorter than serenity's at each end (-9999-01-02T01:59:59Z to 9999-12-30T22:00:00.999999999Z). A Discord timestamp outside it gives None, and the PRIVMSG has no @time= tag (spec 05). The Discord event fields are now Option<jiff::Timestamp>.
    • The outbound @time= text does not change: YYYY-MM-DDTHH:MM:SS.mmmZ. New tests pin it.
    • Behaviour change to check: the inbound @time= parser now accepts the wider jiff::fmt::temporal grammar, not only RFC 3339. Examples are basic format, an offset of hours only, and a time zone annotation. A leap second becomes :59. Nothing reads this field today. Spec 02 records it.

It also sets gitignore = true in .cargo/mutants.toml. Since cargo-mutants 25.0.2 the default is off, and a local run copies .claude/worktrees into each build directory.

RUSTSEC-2026-0440 (astral-tokio-tar) still fails the Advisories job. #129 handles it.

Not done: the serenity feature list keeps framework and standard_framework, which disirc does not use. Removing them is a separate change; this PR only removes chrono from the defaults.

Test plan

  • cargo test
  • cargo clippy --all-targets -- -D warnings
  • cargo fmt --check
  • cargo deny check bans licenses sources
  • cargo mutants --in-diff on the branch: 8 mutants, 6 caught, 2 unviable

url 2.5.8 has RUSTSEC-2026-0592: Url::origin() recurses once for each
nested blob: prefix, so a long URL overflows the stack. The update also
moves form_urlencoded from 1.2.2 to 1.2.3, which url 2.5.9 requires.

Signed-off-by: Jonathan Oddy <jonathan@woaf.net>
chrono is unmaintained (RUSTSEC-2026-0543), and no version fixes it.
Replace it with jiff::Timestamp, which the serenity next branch also
uses.

- Turn off the chrono feature of serenity. Its Timestamp then wraps
  time::OffsetDateTime, and message_time() converts that to jiff.
- jiff stops about one day before the ends of years -9999 and 9999. A
  Discord timestamp outside that range converts to None, and the
  PRIVMSG then has no @time= tag (spec 05). The Discord event fields
  are now Option<jiff::Timestamp>.
- Add tests that fix the @time= text as YYYY-MM-DDTHH:MM:SS.mmmZ. They
  passed on chrono before the change.

Signed-off-by: Jonathan Oddy <jonathan@woaf.net>
cargo-mutants turned off gitignore filtering by default in 25.0.2. Each
job then copies .claude/worktrees with the target directory of each
worktree, and a local run fills the disk.

Signed-off-by: Jonathan Oddy <jonathan@woaf.net>
Review findings 1, 2 and Part 2 item 2:
- jiff parses @time= with the wider jiff::fmt::temporal grammar, not
  only RFC 3339. Spec 02 now says so, and two tests pin it.
- Split the outbound tag property into a shape test (years 0 to 9999)
  and a round-trip test over the whole jiff range. The round trip
  rounds down to milliseconds, also before 1970.
- Remove outbound_message_with_timestamp_and_mtags_emits_time_tag.
  outbound_time_tag_has_milliseconds_and_zulu checks the same input
  with the exact text.

Signed-off-by: Jonathan Oddy <jonathan@woaf.net>
Review findings 3, 4 and 7:
- The jiff range is about one day shorter than serenity's at each end:
  -9999-01-02T01:59:59Z to 9999-12-30T22:00:00.999999999Z. The earlier
  text was wrong at the low end. Spec 05 cites the jiff docs.
- Remove the message_time property test. It drew only whole
  milliseconds, and the unit tests already pin both limits, the values
  just outside them, and microsecond precision.

Signed-off-by: Jonathan Oddy <jonathan@woaf.net>
Review finding 6: spec 05 TODO no longer says chrono, and the serenity
0.13 item says to remove message_time.

Signed-off-by: Jonathan Oddy <jonathan@woaf.net>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant