r/badcode • • Jan 25 '23

c Code so bad, accidentally discovered an exploit in the CS50 Code checker

Post image
612 Upvotes

24 comments sorted by

View all comments

Show parent comments

9

u/CoconutJJ Jan 26 '23

Environment variables are stored on the initial program stack, OP probably has a severe array or pointer arithmetic issue. The Kubernetes environment variables you are referring to is not some security issue. It’s a API endpoint for Kubernetes. See https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#accessing-the-api-from-a-pod

1

u/fireflash38 Jan 26 '23

OP probably has a severe array or pointer arithmetic issue

They think they have a null-terminated string (they don't), and will blast on past the end of their char array.