Skip to content
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

[SOOS] Vulnerability GHSA-wfg4-322g-9vqv detected in Rust memoffset@0.5.6 #31

Closed
soos-security-analysis-qa bot opened this issue Aug 26, 2024 · 0 comments

Comments

@soos-security-analysis-qa
Copy link

A Medium severity Vulnerability GHSA-wfg4-322g-9vqv detected in Rust memoffset@0.5.6 was detected in Cargo.lock.


Details
https://qa-app.soos.io/c/in6/h/h7s7ot/projects/3rkyduoo0/branches/filescan0/issues?source=Vulnerability&search=GHSA-wfg4-322g-9vqv&


Description
memoffset allows reading uninitialized memory memoffset allows attempt of reading data from address 0 with arbitrary type. This behavior is an undefined behavior because address 0 to std::mem::size_of<T> may not have valid bit-pattern with T. Old implementation dereferences uninitialized memory obtained from std::mem::align_of. Older implementation prior to it allows using uninitialized data obtained from std::mem::uninitialized with arbitrary type then compute offset by taking the address of field-projection. This may also result in an undefined behavior for "father" that includes (directly or transitively) type that does not allow to be uninitialized.

This flaw was corrected by using std::ptr::addr_of in Gilnaa/memoffset#50.

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

No branches or pull requests

1 participant