All notable changes to this project are documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.
Versions are recorded here and in didJavaScriptFunctionRun/VERSION. The
project does not publish GitHub releases or tags.
Security release. Every installation of 1.0.0 should replace its
didJavaScriptFunctionRun folder with this version. The pages that use the
template need no change.
- Fixed command injection in
scripts/make_random_file.php,scripts/delete_random_file.phpandscripts/did_java_script_function_run.php, where request input could reach shell commands. Every shell command is removed, and both endpoints now refuse anything other than the 8 random letters the browser script generates. - Fixed reflected cross-site scripting through the
didJavaScriptFunctionRunIDfield.$didJavaScriptFunctionRunIDis now validated when it is set, so pages that echo it unescaped (install step 4) are safe without being edited. - Removed the generation and inclusion of a PHP file built from request input.
- Removed a loop that held a PHP worker for about five minutes on every page view, which let a few dozen requests exhaust a server's PHP workers.
- If 1.0.0 ran on a publicly reachable server, check that server for files you did not create.
didJavaScriptFunctionRun/VERSION, holding the installed version. A folder without it is 1.0.0.make_random_file.phpanddelete_random_file.phpsendCache-Control: no-storeandX-Content-Type-Options: nosniff.
clean_random_character_function()validates instead of cleaning. It returns the trimmed value when it holds only letters, digits and underscores (up to 160 characters), and an empty string otherwise.- Random folders in
tmp/expire after 30 minutes instead of being kept for up to a day, and are removed by PHP instead of byfindandrm. The cleanup keepsREADME.mdand editor metadata folders named_notes. - The curl user-agent check now also runs in
didJavaScriptFunctionRun.php, matches case-insensitively, and reads the user agent from$_SERVER. - README step 4, the example form, and the demonstration page escape
$didJavaScriptFunctionRunIDwhen they echo it.
- A fatal
TypeErroron PHP 8 indidJavaScriptFunctionRun.php, caused by callingcount()on a string. - Undefined variable warnings in
didJavaScriptFunctionRun.phponGETrequests, and when the page sets no required field name. didJavaScriptFunctionRun.phplooked for random files relative to the page's working directory instead of its own folder.make_random_file.phptreated the request path as the random characters when the URL had no query string.- The scripts no longer depend on POSIX tools, so they can run on Windows servers.
scripts/template_check.php.
Initial published template.
- Six-step install for PHP forms that post to their own page: a browser
script, a hidden
didJavaScriptFunctionRunIDfield, and PHP includes that set$didJavaScriptFunctionRunto1when JavaScript ran in the browser that submitted the form, and0otherwise. - File-based check: the browser asks
scripts/make_random_file.phpto create a random folder intmp/, andscripts/did_java_script_function_run.phpverifies it when the form is submitted. - Example form (
example/feedback.php) and demonstration page (index.html).