codewars / codewars.com

Issue tracker for Codewars

Home Page:https://www.codewars.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pass all tests in a kata with execlp

wizardling1 opened this issue · comments

Describe the bug
I'm not sure if this has already been found or if anyone cares, but I've found a simple way to pass all tests in any exercise if it's a C program. You simply include <unistd.h> and run execlp("ls", "", (char*) 0), then the tester will think the program passed all tests.

To Reproduce
Here is an example of code that can pass the "Regular Expression for Binary Numbers Divisible by n" 1 kyu kata.

#include <unistd.h>
char regex_divisible_by (int n) {
execlp("ls", "", (char
)0);
return 0;
}

Expected behavior
The program passes all tests.

Screenshots
Screenshot 2023-09-20 at 11 56 54 AM

Browser

  • OS: macOS
  • Browser: Chrome

Hello,

Yes, there are numerous ways to bypass the tests like this. It's actually strongly tide to how codewars works and to the general setup needed to provide the intended user-experience. So, it's a "won't fix" thing.

Please note that using this kind of things is considered cheating and penalties may be applied to users utilizing this.

There are a lot of issues talking already about this. See for example here (comment).

Cheers