ncurses-lite
This is a light (microscopic) reimagining of ncurses-rs.
After trying to use ncurses-rs in rust-warrior, and
getting alerted by the Github dependabot, the idea for this
new library was born.
Security Issues
Mishandling of format strings
An issue was discovered in the ncurses crate for Rust. There are format string issues in
printwfunctions because C format arguments are mishandled.
Buffer overflow and format vulnerabilities
An issue was discovered in the ncurses crate for Rust. There are
instrandmvwinstrbuffer overflows because interaction with C functions is mishandled.
The instr function has this comment:
Reassuring, right?
The mvwinstr function has the same comment:
These vulnerabilities have been reported in this issue, which links to:
- CVE-2019-15548 (elaborated in CWE-119)
- CVE-2019-15547 (elaborated in CWE-134)
There are some curses docs online, such as this page that documents the
innstr family of functions.
What if
Given the complex nature of the vulnerable functions, and the difficulty in verifying whether they are currently "broken" or whether a change would be "broken" as well...
AND given that none of these functions are used in rust-warrior...
Another option is to create a library that exposes the necessary parts of ncurses to Rust without including these vulnerabilities -- by simply leaving those functions out.
API
The following functions are implemented:
initscrendwincurs_setnewwinwaddchwaddstrwclearwrefresh