Skip to content

Add advisory for unsound problem in wasmtime_jit_debug #1999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 17, 2025

Conversation

safe4u
Copy link
Contributor

@safe4u safe4u commented Jul 6, 2024

A soundness bug in wasmtime_jit_debug that wrongly marks the function dump_code_load_record as 'safe'.
The issue report: bytecodealliance/wasmtime#8905

@kornelski
Copy link
Contributor

It looks like it's been patched in v27

bytecodealliance/wasmtime@b5e31a5

can you mark it as patched in the advisory?

Copy link
Contributor

@kornelski kornelski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be updated with the patched version

@safe4u
Copy link
Contributor Author

safe4u commented Feb 15, 2025

Needs to be updated with the patched version

Done. Thanks for your correction.

@solomoncyj
Copy link
Contributor

pr is stil not merged. can a maintainer pleser merger it?

@djc
Copy link
Contributor

djc commented May 28, 2025

@alexcrichton any feedback on this one?

@alexcrichton
Copy link
Contributor

Personally, if acceptable, I'd prefer not to merge this. I think this was good to flag on our issue tracker and fix, but it's an internal crate to the project which we've documented users should not use. We have a number of wasmtime-* crates which are internal implementation details not intended for external consumption, and this is likely not the only issue with them. The advisories at least we on Wasmtime worry about are those reachable from public APIs we recommend users use (e.g. the wasmtime crate itself) and we would not accept security advisories for internal crates unless Wasmtime, through the public API, can trigger undefined behavior or such. Effectively while this was a good fix I don't believe this actually poses any risk to users. Anyone using the wasmtime crate itself would not have been exposed to this issue and no one should be using the wasmtime_jit_debug crate directly.

Now how exactly that falls under the advisory db here I'm not sure. We would ideally lint/etc that users shouldn't directly depend on these internal crates (and we could probably do a better job of messaging in Wasmtime as well), but doing so through advisories feels like something we should figure out in Wasmtime better rather than here.

Is it reasonable to ask this not be merged? If it's still desired to be merged I'd ask that we on Wasmtime have a moment to sort out how exactly to best discourage users from using internal crates before this is merged.

Also, as a side note, this advisory says <= 24.0.0 is affected while >= 24.0.0 is patched, meaning that 24.0.0 is simultaneously affected and patched. I believe the affected versions should be < 24.0.0 instead.

@djc
Copy link
Contributor

djc commented May 30, 2025

Is it reasonable to ask this not be merged? If it's still desired to be merged I'd ask that we on Wasmtime have a moment to sort out how exactly to best discourage users from using internal crates before this is merged.

Given the purpose of internal-only usage, we can definitely delay merging this so you can figure out messaging/mitigation.

In my mind, if the crate is published to crates.io as a library that someone could potentially use, then issues with public, safe API should be fair game for advisories... Maybe it could make sense to guard the contents of the crate with an __internals feature and/or doc(hidden) flags?

@Shnatsel, @tarcieri, @alex any thoughts?

@alex
Copy link
Member

alex commented May 30, 2025

I think I agree with that.

@alexcrichton
Copy link
Contributor

Sounds reasonable! I've got an agenda item for our upcoming meeting next Thursday. I'll post here with a response after that

alexcrichton added a commit to alexcrichton/wasmtime that referenced this pull request Jun 6, 2025
This commit is an attempt to more clearly flag internal crates in this
project as internal and not intended for external use. Specifically:

* Many crates are renamed from `wasmtime-foo` to
  `wasmtime-internal-foo`.
* All of these crates now have `INTERNAL: ...` in their crates.io
  description.
* All of these crates now have a warning at the top of their
  documentation discouraging use.

This change is a result of rustsec/advisory-db#1999 where the goal is to
be crystal clear from a project perspective that usage of these crates
are highly discouraged and not supported. We'll still probably get such
advisories but we won't be considering them CVEs from the project itself
due to the internal nature of these crates and the discouraging
warnings.

Some concrete changes used here are:

* Inter-crate dependencies still use `wasmtime_foo` for naming and do
  so with Cargo's package-renaming features.
* Crate renames are specified at the workspace level so the rename is
  only in one locations and all other inherit it.
* Contribution documentation now has some brief guidelines about crate
  organization.
@alexcrichton
Copy link
Contributor

Ok we discussed this yesterday and the discussion culminated in bytecodealliance/wasmtime#10963. We don't plan on retroactively applying this change to older branches but it should at least hopefully mitigate things going forward. In the meantime this seems reasonable to merge to me, I don't expect the fallout to be that large.

github-merge-queue bot pushed a commit to bytecodealliance/wasmtime that referenced this pull request Jun 6, 2025
* More clearly flag internal crates as such

This commit is an attempt to more clearly flag internal crates in this
project as internal and not intended for external use. Specifically:

* Many crates are renamed from `wasmtime-foo` to
  `wasmtime-internal-foo`.
* All of these crates now have `INTERNAL: ...` in their crates.io
  description.
* All of these crates now have a warning at the top of their
  documentation discouraging use.

This change is a result of rustsec/advisory-db#1999 where the goal is to
be crystal clear from a project perspective that usage of these crates
are highly discouraged and not supported. We'll still probably get such
advisories but we won't be considering them CVEs from the project itself
due to the internal nature of these crates and the discouraging
warnings.

Some concrete changes used here are:

* Inter-crate dependencies still use `wasmtime_foo` for naming and do
  so with Cargo's package-renaming features.
* Crate renames are specified at the workspace level so the rename is
  only in one locations and all other inherit it.
* Contribution documentation now has some brief guidelines about crate
  organization.

* Update vet config

* Update checks for wasmtime-fiber

prtest:full

* Update publish script

* Another fiber rename

* Fix some doc tests
github-merge-queue bot pushed a commit to bytecodealliance/wasmtime that referenced this pull request Jun 6, 2025
* More clearly flag internal crates as such

This commit is an attempt to more clearly flag internal crates in this
project as internal and not intended for external use. Specifically:

* Many crates are renamed from `wasmtime-foo` to
  `wasmtime-internal-foo`.
* All of these crates now have `INTERNAL: ...` in their crates.io
  description.
* All of these crates now have a warning at the top of their
  documentation discouraging use.

This change is a result of rustsec/advisory-db#1999 where the goal is to
be crystal clear from a project perspective that usage of these crates
are highly discouraged and not supported. We'll still probably get such
advisories but we won't be considering them CVEs from the project itself
due to the internal nature of these crates and the discouraging
warnings.

Some concrete changes used here are:

* Inter-crate dependencies still use `wasmtime_foo` for naming and do
  so with Cargo's package-renaming features.
* Crate renames are specified at the workspace level so the rename is
  only in one locations and all other inherit it.
* Contribution documentation now has some brief guidelines about crate
  organization.

* Update vet config

* Update checks for wasmtime-fiber

prtest:full

* Update publish script

* Another fiber rename

* Fix some doc tests
@djc
Copy link
Contributor

djc commented Jun 13, 2025

@alexcrichton any feedback on the advisory contents? Should we add a note about this being an internal crate?

@alexcrichton
Copy link
Contributor

Yeah that would probably be best, something along the lines of:

Note: this is an internal-only crate in the Wasmtime project not intended for external use and is more strongly signaled nowadays as of bytecodealliance/wasmtime#10963. Please open an issue in Wasmtime if you're using this crate directly.

@djc
Copy link
Contributor

djc commented Jun 14, 2025

@safe4u can you add this note to the advisory?

@djc djc merged commit a5f88f0 into rustsec:main Jun 17, 2025
1 check passed
@safe4u
Copy link
Contributor Author

safe4u commented Jun 17, 2025

Thank you all for your attention to this minor problem : )

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.

7 participants