Security mailing lists by PureSourceCode

GHSA-wfg4-322g-9vqv

MEDIUM

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 https://github.com/Gilnaa/memoffset/pull/50.

Published
21 Jun 2023
Last modified
8 Nov 2023
Also known as
RUSTSEC-2023-0045
Sources
OSVJSONOSV RUSTSEC-2023-0045JSON

Affected

SourceVendor / ecosystemProduct / packageAffected versionsFixed in
OSV crates.io memoffset < 0.6.2 0.6.2
OSV crates.io memoffset >= 0.0.0-0, < 0.6.2 0.6.2

References

History

  • 25 Nov 2026 20:14 UTC · OSV: first stored (published 21 Jun 2023)
  • 25 Nov 2026 20:14 UTC · OSV: first stored (published 21 Jun 2023)
An unhandled error has occurred. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.