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 when reading strings from the targets file #14

Open
firmianay opened this issue Jul 7, 2022 · 0 comments
Open

buffer overflow when reading strings from the targets file #14

firmianay opened this issue Jul 7, 2022 · 0 comments

Comments

@firmianay
Copy link

firmianay commented Jul 7, 2022

hi, great project!

There is a stack overflow in the process_append function of the program because the length of the string read in the targets file is not checked. And the same problem exists in process_prepend.

void process_append()
{
        for (auto append = append_list.begin(); append != append_list.end(); ++append)
        {
            if (!(std::find(exclude_list.begin(), exclude_list.end(), *target) != exclude_list.end()))
            {
                string appnd = *append;

                // First level
                char a[1024] = {};
                strncpy(a, targ.c_str(), location);
                strcat(a, "-");
                char temp[1024] = {};
                strncpy(temp, appnd.c_str(), appnd.length());
                strcat(a, temp);
                strcat(a, targ.substr(location, targ.length() - location).c_str());
                print_domain(string(a));
$ ./DNScewl --tL target.txt -a append.txt
[2022-07-07 14:33:27.345] [info]                    
...
[1]    1370 segmentation fault  ./DNScewl --tL target.txt -a append.txt
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

1 participant