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
Copy file name to clipboardExpand all lines: README.md
+31-13Lines changed: 31 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -15,13 +15,30 @@
15
15
16
16
**cve-rs** allows you to introduce common memory vulnerabilities (such as buffer overflows and segfaults) into your Rust program in a memory safe manner.
17
17
18
-
Rust is an amazing language. You can program a lot of useful things while ensuring that your program will stay safe. Unfortunately, safe Rust is quite limiting. For example, you cannot introduce code that could corrupt the program's memory. Now, with **cve-rs**, you can corrupt your program's memory without corrupting your program's memory.
18
+
## Why choose **cve-rs**?
19
+
- 🩸 Bleeding edge technology
20
+
- 🕹️ Paradigm-changing (no more unsafe code!)
21
+
- 🔥 Blazingly fast
22
+
- 💡 Easy to use
23
+
- Featuring way 👋 too 2️⃣ many 🤯 emojis in the 📖 readme 🔥 🦀 💨
24
+
-**🦀 Built in 100% memory-safe Rust!**
25
+
26
+
## Example
27
+
```rs
28
+
// With cve-rs, you can crash prod in a 🔥 blazingly fast manner!
29
+
pubfnsegfault() {
30
+
letnull:&mutu8=cve_rs::null_mut::<u8>();
31
+
*null=42;
32
+
}
33
+
```
34
+
35
+

19
36
20
-
We are very committed to making sure **cve-rs** is memory-safe. We know that unsafe code can have unintended consequences, such as memory unsafety that causes programs to be insecure or unstable.
37
+
Rust is an amazing language! You can program a lot of useful things while ensuring that your program will stay safe. Unfortunately, safe Rust is quite limiting. For example, you cannot introduce code that could corrupt the program's memory. Now, with **cve-rs**, **you can corrupt your program's memory without corrupting your program's memory!**
21
38
22
-
That is why **cve-rs**uses `#![deny(unsafe_code)]` in the entire codebase. There is not a single block of `unsafe` code* in this project.
39
+
We are very committed to making sure **cve-rs**is memory-safe. We know that unsafe code can have unintended consequences, such as memory unsafety that causes bugs like segmentation faults, use-after-frees, and buffer overflows!
23
40
24
-
> *\* There is, unfortunately, one exception: In our tests, we compare the results of our safe `transmute` function against the regular `std::mem::transmute` function. Perhaps somewhat shortsightedly, the standard library implementation is unsafe. Regardless, this is only in our tests - the core library has no unsafe code.*
41
+
That is why **cve-rs** uses `#![deny(unsafe_code)]` in the entire codebase. There is not a single block of `unsafe` code (except for some [tests](./src/transmute.rs#L56)) in this project.
25
42
26
43
**cve-rs** implements the following bugs in safe Rust:
27
44
@@ -34,29 +51,26 @@ That is why **cve-rs** uses `#![deny(unsafe_code)]` in the entire codebase. Ther
34
51
-`std::mem::transmute`
35
52
-`std::ptr::null()`/`null_mut()` but for references
36
53
37
-
Here is an example of usage with the `segfault` subcommand:
38
-
39
-

40
-
41
-
## Install
54
+
## Installation
42
55
43
56
**cve-rs** can be used directly with Cargo.
44
57
45
58
To use it as a library:
46
59
47
60
```sh
48
-
cargo add cve-rs
61
+
$ cargo add cve-rs
49
62
```
50
63
51
64
Or to run our example binary:
52
65
53
66
```sh
54
-
cargo install cve-rs
67
+
$ cargo install cve-rs
68
+
$ cve-rs
55
69
```
56
70
57
71
## WASM support
58
72
59
-
**cve-rs** supports WASM through the WASI API.
73
+
**cve-rs** supports WASM through the WASI API, and also to Webassembly that you can run in a browser!
60
74
61
75
You can compile it and run it using [Wasmer](https://wasmer.io/) with the following commands:
Special thanks to [@Bright-Shard](https://github.com/Bright-Shard) and [@Creative0708](https://github.com/Creative0708)!
88
+
Special thanks to [@Bright-Shard](https://github.com/Bright-Shard) and [@Creative0708](https://github.com/Creative0708), and everyone else that contributed to **cve-rs**!
0 commit comments