Why security matters for PHP endpoints, what the threats actually are, and exactly how yttcom.net defends against them.
The moment a PHP file is live on the internet, anyone in the world can call it. Bots scan every IP address constantly looking for open endpoints. If your file_write.php has no protection, someone will find it and start writing files to your server.
A token is a long secret string that only authorized callers know. Every request to a yttcom.net endpoint must include the token. The PHP script checks it immediately — if it is wrong or missing, the script stops and returns a 403 error. Nothing else happens.
Regular string comparison === stops the moment it finds a difference. This means it takes slightly longer to reject "yttcom-admin-x..." than to reject "wrong". An attacker can measure these tiny time differences and guess the token one character at a time.
hash_equals() always takes the same amount of time regardless of where the strings differ. This closes that loophole completely.
If your endpoint lets callers specify a filename, an attacker might send ../../etc/passwd as the filename. The ../ means "go up one folder" — they are trying to climb out of your directory and read sensitive system files.
Brute force means trying thousands of different tokens until one works. Rate limiting stops this by tracking how many failed attempts come from each IP address, and blocking that IP after too many failures.
When you read from $_POST or $_GET, the key might not exist. PHP will throw a warning if you try to read a missing key. The ?? operator gives you a safe default instead.
Every yttcom.net PHP endpoint does all of these:
✅ Token check with hash_equals() — first thing, before anything else
✅ Rate limiting — 10 failures per IP per 5 minutes → HTTP 429
✅ PHP version hidden — header_remove("X-Powered-By")
✅ CORS locked to https://yttcom.net only
✅ basename() on all user-supplied filenames
✅ .htaccess protecting data directories from browser access
Still pending (David action required):
⏳ .htaccess on /sessions/, /transfers/, /systems/, /core/
⏳ CORS fix on save.php and load.php (currently wildcard *)