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

Fix ncurses crate #30

Open
Lokathor opened this issue Sep 3, 2019 · 6 comments
Open

Fix ncurses crate #30

Lokathor opened this issue Sep 3, 2019 · 6 comments

Comments

@Lokathor
Copy link
Contributor

Lokathor commented Sep 3, 2019

It's a very low-download crate, but people still use it.

I've filed an issue just now asking them to remove all invalid unsafe{} blocks, and this issue here is just a bit of a tracker/reminder that the process has been poked in the right direction.

@Shnatsel
Copy link
Member

Shnatsel commented Sep 3, 2019

That crate currently has exploitable security vulnerabilities in safe functions. There is even a security advisory about it: https://rustsec.org/advisories/RUSTSEC-2019-0006.html

pancurses crate has the same issues, also unaddressed: https://rustsec.org/advisories/RUSTSEC-2019-0005.html

@Lokathor
Copy link
Contributor Author

Lokathor commented Sep 3, 2019

:ferrisSweat:

@Shnatsel Shnatsel changed the title ncurses crate Fix ncurses crate Sep 3, 2019
@Shnatsel
Copy link
Member

Shnatsel commented Sep 3, 2019

That crate's stated goal is to provide a thin Rust wrapper, so it should just be called ncurses-sys and expose all functions as unsafe fn. Which it currently doesn't, and that's a problem.

@Lokathor
Copy link
Contributor Author

Lokathor commented Sep 3, 2019

one issue is that in ncurses there's a huge pile of CPP macros defined, so if you only expose the real functions you end up with a lib that is harder to use than "actual" ncurses.

So some amount of something needs to happen

@Shnatsel
Copy link
Member

Shnatsel commented Nov 2, 2019

There is one other crate wrapping ncurses - https://crates.io/crates/ncursesw
It has its own bindings and seems to be in a better shape, plus has safe wrappers on top. There's probably opportunity for collaboration there. Or we could just convert all users of ncurses crate to it.

Alternatively we can mark all ncurses crate functions unsafe and call it a day, but then all the users like pancurses (of which there are many) are going to be dealing with that unsafety, which is not ideal.

@Lokathor
Copy link
Contributor Author

Lokathor commented Nov 2, 2019

it's maybe worth noting that, outside of very special circumstances, ncurses doesn't exist on modern systems. It's just a facade lib that actually wraps ncursesw anyway.

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

2 participants