You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Update Rust crate tracing to v0.1.40 [SECURITY] - #127
The implementation of the Instrumented::into_inner method in affected versions of this crate contains undefined behavior due to incorrect use of std::mem::forget The function creates *const pointers to self, calls mem::forget(self), and then moves values out of those pointers using std::ptr::read.
// To manually destructure `Instrumented` without `Drop`, we// move it into a ManuallyDrop and use pointers to its fieldslet span:*constSpan = &this.span;let inner:*constManuallyDrop<T> = &this.inner;
mem::forget(self);// SAFETY: Those pointers are valid for reads, because `Drop` didn't// run, and properly aligned, because `Instrumented` isn't// `#[repr(packed)]`.let _span = unsafe{ span.read()};let inner = unsafe{ inner.read()};
Any resources the value manages, such as heap memory or a file handle, will
linger forever in an unreachable state. However, it does not guarantee that
pointers to this memory will remain valid.
This means that these pointers are no longer valid. This could result in a stack use-after-free if LLVM chooses to reuse self's stack slot for a rebinding after the call to std::mem::forget.
This undefined behavior has not been observed to cause miscompilation as of Rust 1.73.0. However, any use of this method with the affected versions of tracing are unsound.
The flaw was corrected in commit 20a1762 (PR #2765) by replacing the use of std::mem::forget with std::mem::ManuallyDrop, ensuring that the stack slot is not reused and the pointers remain valid when they are read. The fix is
published in tracingv0.1.40. Affected versions have been yanked from crates.io.
This release adds several additional features to the tracing macros. In
addition, it updates the tracing-core dependency to v0.1.32 and
the tracing-attributes dependency to v0.1.27.
This tracing release changes the Drop implementation for Instrumented Futures so that the attached Span is entered when dropping the Future. This
means that events emitted by the Future's Drop implementation will now be
recorded within its Span. It also adds #[inline] hints to methods called in
the event! macro's expansion, for an improvement in both binary size and
performance.
Additionally, this release updates the tracing-attributes dependency to v0.1.24, which updates the syn dependency to v2.x.x. tracing-attributes v0.1.24 also includes improvements to the #[instrument]
macro; see the tracing-attributes 0.1.24 release notes for
details.
Added
Instrumented futures will now enter the attached Span in their Drop
implementation, allowing events emitted when dropping the future to occur
within the span (#2562)
#[inline] attributes for methods called by the event! macros, making
generated code smaller (#2555)
attributes: level argument to #[instrument(err)] and #[instrument(ret)] to override the level of
the generated return value event (#2335)
attributes: Improved compiler error message when #[instrument] is added to a const fn
(#2418)
To trigger a single review, invoke the @coderabbitai review command.
⚙️ Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: a2d38543-a566-4a22-987a-8b37fe991714
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
🔍 Trigger review
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 54c874d7-8117-485b-ba20-6e5312b8b5e7
📥 Commits
Reviewing files that changed from the base of the PR and between fcb1c98 and 9f8d850.
⛔ Files ignored due to path filters (2)
pkgs/pavex/libs/Cargo.lock is excluded by !**/*.lock
pkgs/web-gen/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
pkgs/web-gen-api-axum/Cargo.toml
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
📝 Walkthrough
The optional tracing dependency requirement in the Axum API package changed from version 0.1.37 to 0.1.40.
The optional tracing dependency now requires at least 0.1.40. No concrete merge-blocking issue was identified.
Architecture risk:🔵 Low · up to 9f8d8
The change affects 1 system.
Changed systems:pkgs
Architecture concerns
No architecture-level concerns identified.
Review details
Systems and components
observed — pkgs (service) was modified; 1 changed file maps to changed impact.
Before / after behavior
observed — Modified behavior in pkgs/web-gen-api-axum/Cargo.toml: The optional tracing dependency requirement was raised from version 0.1.37 to 0.1.40.
Pre-merge checks: 5
Passed checks (5 passed)
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely identifies the tracing dependency update to version 0.1.40 and its security purpose.
Docstring Coverage
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
renovateBot
changed the title
fix(deps): update rust crate tracing to v0.1.40 [security]
Update Rust crate tracing to v0.1.40 [SECURITY]
Oct 22, 2026
renovateBot
changed the title
Update Rust crate tracing to v0.1.40 [SECURITY]
Update Rust crate tracing to v0.1.40 [SECURITY] - autoclosed
Oct 22, 2026
renovateBot
changed the title
Update Rust crate tracing to v0.1.40 [SECURITY] - autoclosed
Update Rust crate tracing to v0.1.40 [SECURITY]
Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.1.37→0.1.400.1.37→0.1.40use-after-free in tracing
GHSA-8f24-6m29-wm2r
More information
Details
The implementation of the
Instrumented::into_innermethod in affected versions of this crate contains undefined behavior due to incorrect use ofstd::mem::forgetThe function creates*constpointers toself, callsmem::forget(self), and then moves values out of those pointers usingstd::ptr::read.However, the
mem::forgetdocumentation states:This means that these pointers are no longer valid. This could result in a stack use-after-free if LLVM chooses to reuse
self's stack slot for a rebinding after the call tostd::mem::forget.This undefined behavior has not been observed to cause miscompilation as of Rust 1.73.0. However, any use of this method with the affected versions of
tracingare unsound.The flaw was corrected in commit 20a1762 (PR #2765) by replacing the use of
std::mem::forgetwithstd::mem::ManuallyDrop, ensuring that the stack slot is not reused and the pointers remain valid when they are read. The fix ispublished in
tracingv0.1.40. Affected versions have been yanked from crates.io.Thanks to Taylor Cramer and Manish Goregaokar for finding and correcting
this issue!
Severity
Medium
References
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
tokio-rs/tracing (tracing)
v0.1.40: tracing 0.1.40Compare Source
This release fixes a potential stack use-after-free in the
Instrument::into_innermethod. Only uses of this method are affected by thisbug.
Fixed
mem::ManuallyDropinstead ofmem::forgetinInstrument::into_inner(#2765)
Thanks to @cramertj and @manishearth for finding and fixing this issue!
v0.1.39: tracing 0.1.39Compare Source
This release adds several additional features to the
tracingmacros. Inaddition, it updates the
tracing-coredependency to v0.1.32 andthe
tracing-attributesdependency to v0.1.27.Added
ValueSets of any length (#2508)Changed
tracing-attributes: updated to 0.1.27tracing-core: updated to 0.1.32Fixed
(#2621, #2757)
clippy::let_with_type_underscore] in macro-generatedcode ([#2609])
unknown_lintsin macro-generated code (#2626)#[instrument]when the"log"feature is enabled (#2599)
Documented
axum-insightsto relevant crates. (#2713)clippy-tracingto related crates (#2628)tracing-cloudwatchto related crates (#2667)tracing-etwrepo (#2602)v0.1.38: tracing 0.1.38Compare Source
This
tracingrelease changes theDropimplementation forInstrumentedFutures so that the attachedSpanis entered when dropping theFuture. Thismeans that events emitted by the
Future'sDropimplementation will now berecorded within its
Span. It also adds#[inline]hints to methods called inthe
event!macro's expansion, for an improvement in both binary size andperformance.
Additionally, this release updates the
tracing-attributesdependency tov0.1.24, which updates the
syndependency to v2.x.x.tracing-attributesv0.1.24 also includes improvements to the#[instrument]macro; see the
tracing-attributes0.1.24 release notes fordetails.
Added
Instrumentedfutures will now enter the attachedSpanin theirDropimplementation, allowing events emitted when dropping the future to occur
within the span (#2562)
#[inline]attributes for methods called by theevent!macros, makinggenerated code smaller (#2555)
levelargument to#[instrument(err)]and#[instrument(ret)]to override the level ofthe generated return value event (#2335)
#[instrument]is added to aconst fn(#2418)
Changed
tracing-attributes: updated to 0.1.24cfg-ifdependency (#2553)syndependency to 2.0 (#2516)Fixed
clippy::unreachablewarnings in#[instrument]-generated code (#2356)syndependency (#2530)Documented
#[instrument(err)](#2433)#[instrument](#2350)Thanks to @nitnelave, @jsgf, @Abhicodes-crypto, @LukeMathWalker, @andrewpollack,
@quad, @klensy, @davidpdrsn, @dbidwell94, @ldm0, @NobodyXu, @ilsv, and @daxpedda
for contributing to this release!
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.