947 karma · joined December 2, 2020
Update: I fixed this on github.
m = n
? /* if (n != 0) */
/* adds index.html if path ends with "/" (means the filename is omitted), otherwise copies zero */
strcpy(b+i-1,b[i-2]-'/'?"":"index.html"),
/* log the requested filename to stdout */
printf("%s\n",b+5),
/* if "/." is in the path or an error occurred while opening the file */
strstr(b,"/.")||!(f=fopen(b+5,"rb"))
? "404 Not Found"
: "200 OK"
: "501 Not Implemented"; /* if (n == 0) */
By filtering filenames with "/." I prevent exploits with ".." and also don't allow to read files starting with a dot, these are hidden files in Unix-like OS. char main
[/*x86*/]
__attribute__
((section(".text"))
)="WTYH)9Zj8_j7H)9]R"
"H)9^\350\0\0\0\0H)1^R"
"H))Z8<2u\366j<)9Xj9"
")9j9VY)<$[S_H\xbd^["
"H$@\xcd\200-XP\xf"
"\5XP_j<W\xeb\xe2]"
"Hello World!\n";
/*Linux_Only!*/Remote: Yes
Willing to relocate: Probably not
Technologies: C/Assembly, SIMD (SSE/AVX/NEON/HVX and others), OpenCL, OpenMP
Résumé/CV: https://www.linkedin.com/in/ilya-kurdyukov-a7304119b/
Github: https://github.com/ilyakurdyukov/
Email: jpegqs at gmail com
I specialize in optimizing code to achieve better performance (especially in image processing).
But the "(i >= 0 && i < n)" way that I used in this example - I have seen many times.
So hackers can scan open source software compiled with GCC for such issue and can exploit this vulnerability, since GCC developers will not fix it.
Checked that the code works as expected with this option.
And this is related to a possible security vulnerability, so it should be taken more seriously.
Remote: Yes
Willing to relocate: Probably not
Technologies: C/Assembly, SIMD (SSE/AVX/NEON/HVX and others), OpenCL, OpenMP
Résumé/CV: https://www.linkedin.com/in/ilya-kurdyukov-a7304119b/
Github: https://github.com/ilyakurdyukov/
Email: jpegqs at gmail com
I specialize in optimizing code to achieve better performance (especially in image processing).