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

Buffer overflow in cmd.c #9

Closed
prodigysml opened this issue Mar 4, 2018 · 1 comment
Closed

Buffer overflow in cmd.c #9

prodigysml opened this issue Mar 4, 2018 · 1 comment

Comments

@prodigysml
Copy link

A buffer overflow scenario can be created within cmd.c. The cmd_args variable within the char *Cmd_Args function is vulnerable to this attack.

The cmd_args variable assigns all the arguments within argv to a single variable, space delimited.

strcat( cmd_args, cmd_argv[i] );

This variable has allotted 1024 bytes for characters as displayed below:

#define MAX_STRING_CHARS 1024 // max length of a string passed to Cmd_TokenizeString

If we provide arguments with length > 2000, this variable should overflow and cause a crash.

@ec-
Copy link
Owner

ec- commented Mar 4, 2018

@prodigysml thank you for report, it helped to discover other related flaws

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