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

printw should not be exposed. #172

Closed
thomcc opened this issue Nov 27, 2018 · 2 comments
Closed

printw should not be exposed. #172

thomcc opened this issue Nov 27, 2018 · 2 comments

Comments

@thomcc
Copy link

thomcc commented Nov 27, 2018

It's very difficult / impossible to use this function from rust without introducing a format string vulnerability into your code (which can be used to trigger arbitrary code execution).

If you must expose something like it, have it just call addstr or mark it as unsafe (and deprecate it in both cases, IMO).

See also: #149 and #125.

@thomcc
Copy link
Author

thomcc commented Jun 9, 2019

This function still should have been marked as unsafe, since it's trivial to cause an exploitable memory safety issue when calling it...

@Shnatsel
Copy link

Shnatsel commented Jun 9, 2019

Deprecation is definitely insufficient because it's not transitive, and more importantly, people do not expect "deprecated" to mean "using this may cause memory errors". However, that's exactly what unsafe fn communicates.

This is a serious security issue - such bugs can be easily exploited to get remote code execution. Please mark printw as unsafe fn and release an updated version. This is a breaking change, but I don't see a way to fix the exploit in a semver-compatible way.

Stef-Gijsberts pushed a commit to Stef-Gijsberts/chessmind that referenced this issue May 7, 2021
Because the usage of 'printw' is deprecated.
Also see: jeaye/ncurses-rs#172
yshavit added a commit to yshavit/wordle-guesser that referenced this issue Apr 10, 2023
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