{"id":404779,"date":"2026-11-30T17:35:22","date_gmt":"2026-11-30T17:35:22","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/race-guard\/"},"modified":"2026-11-30T17:34:50","modified_gmt":"2026-11-30T17:34:50","slug":"cozzetto-toctou-guard","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/cozzetto-toctou-guard\/","author":14743249,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"2.0.3","stable_tag":"2.0.3","tested":"7.1.5","requires":"6.2","requires_php":"7.4","requires_plugins":null,"header_name":"Cozzetto's TOCTOU Guard","header_author":"carlocozzetto","header_description":"Previene gli attacchi TOCTOU (time-of-check \/ time-of-use) e la doppia esecuzione delle richieste. Quando arrivano piu' richieste POST identiche nello stesso istante (doppio clic o attacco), la prima vince e le gemelle vengono respinte, in modo atomico tramite il database. Avvisa l'amministratore via email e invia un report periodico degli IP bloccati.","last_updated":"2026-11-30 17:34:50","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"https:\/\/cozzetto.eu","rating":0,"author_block_rating":0,"active_installs":0,"downloads":58,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"2.0.3":{"tag":"2.0.3","author":"carlocozzetto","date":"2026-11-30 17:34:50","revision":3835753}},"upgrade_notice":[],"ratings":[],"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["2.0.3"],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[296625,296626,296624,600,296623],"plugin_category":[54],"plugin_contributors":[273254],"plugin_business_model":[],"class_list":["post-404779","plugin","type-plugin","status-publish","hentry","plugin_tags-double-submit","plugin_tags-idempotency","plugin_tags-race-condition","plugin_tags-security","plugin_tags-toctou","plugin_category-security-and-spam-protection","plugin_contributors-carlocozzetto","plugin_committers-carlocozzetto"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/cozzetto-toctou-guard.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>Cozzetto's TOCTOU Guard protects the site against a class of TOCTOU\n(time-of-check \/ time-of-use) attacks and against accidental double execution.<\/p>\n\n<p>When several identical POST requests arrive at the same moment -- from a user\ndouble-clicking, or from an attack firing many twin requests -- the first\nrequest wins and the others are rejected. The decision is made atomically by\nthe database through a unique key, so the race that a TOCTOU attack relies on\ndoes not exist.<\/p>\n\n<p>Problems it avoids: duplicate orders, duplicate sign-ups, double votes, a\ncoupon used twice.<\/p>\n\n<p>Email alerts: when a block is triggered, the site administrator receives an\nimmediate email (at most one per IP per hour, to avoid flooding the mailbox).\nA periodic report (daily, weekly or monthly) lists the blocked IP addresses\nwith full details. A button lets you send the report on demand.<\/p>\n\n<p>Optional IP geolocation: you can enable geolocation of blocked IP addresses\n(off by default). See \"External services\" below.<\/p>\n\n<p>Lightweight: two small tables, no external library, no paid service. Designed\nnot to break legitimate traffic (different submissions have different content\nand always pass; on an internal error the request is allowed through).<\/p>\n\n<h3>External services<\/h3>\n\n<p>This plugin can optionally use the geolocation service ip-api.com.<\/p>\n\n<p>The service is used ONLY when the \"IP geolocation\" option is enabled on the\nsettings screen. This option is OFF by default, so by default the plugin\ncontacts no external service at all.<\/p>\n\n<p>When the option is enabled, and only when a request is blocked, the plugin\nsends the blocked visitor's IP address to ip-api.com in order to obtain the\ncountry, city and network provider of that IP. This information is then shown\nin the administrator's alert email and in the periodic report. The result is\ncached for up to 12 hours per IP to limit the number of calls. No data is sent\nwhile the option is disabled.<\/p>\n\n<p>Service provider: ip-api.com (endpoint http:\/\/ip-api.com\/json\/).\nTerms of use and privacy notice: https:\/\/ip-api.com\/docs\/legal<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload the <code>cozzetto-toctou-guard<\/code> folder to <code>\/wp-content\/plugins\/<\/code>, or\ninstall the zip from the Plugins screen.<\/li>\n<li>Activate the plugin.<\/li>\n<li>Go to Settings -&gt; Cozzetto's TOCTOU Guard to turn protection on or off, set\nthe block window in seconds, enable email alerts, choose the report\nfrequency and, if you want it, enable IP geolocation.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"can%20it%20block%20a%20normal%20user%3F\"><h3>Can it block a normal user?<\/h3><\/dt>\n<dd><p>No. Two different submissions have different content, so they pass. Only the\nidentical copy arriving within a few seconds is rejected.<\/p><\/dd>\n<dt id=\"who%20receives%20the%20email%20alerts%3F\"><h3>Who receives the email alerts?<\/h3><\/dt>\n<dd><p>The site administrator address by default. You can set a different address on\nthe settings screen.<\/p><\/dd>\n<dt id=\"does%20the%20plugin%20contact%20any%20external%20service%3F\"><h3>Does the plugin contact any external service?<\/h3><\/dt>\n<dd><p>Only if you turn on the optional IP geolocation. It is off by default. See the\n\"External services\" section above.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>2.0.3<\/h4>\n\n<ul>\n<li>Author set to the WordPress.org account (carlocozzetto); brand on Author URI.<\/li>\n<\/ul>\n\n<h4>2.0.2<\/h4>\n\n<ul>\n<li>Top-level admin menu (own entry with a shield icon) instead of a Settings\nsubmenu.<\/li>\n<li>The settings screen now shows the log of the latest blocks (date, IP,\nlocation, page, user).<\/li>\n<\/ul>\n\n<h4>2.0.1<\/h4>\n\n<ul>\n<li>\"Tested up to\" set to the current WordPress release (7.1).<\/li>\n<\/ul>\n\n<h4>2.0.0<\/h4>\n\n<ul>\n<li>Renamed to \"Cozzetto's TOCTOU Guard\" (slug cozzetto-toctou-guard) and\nreprefixed all internal names, functions, options, tables and hooks.<\/li>\n<li>IP geolocation via ip-api.com is now an opt-in option, OFF by default, and is\ndocumented under \"External services\".<\/li>\n<li>Settings screen updated accordingly.<\/li>\n<\/ul>\n\n<h4>1.1.3<\/h4>\n\n<ul>\n<li>Minimum WordPress set to a current release.<\/li>\n<\/ul>\n\n<h4>1.1.2<\/h4>\n\n<ul>\n<li>Minimum WordPress raised to 6.2 (required by the %i identifier placeholder and\nwp_date). Passes Plugin Check with no errors.<\/li>\n<\/ul>\n\n<h4>1.1.1<\/h4>\n\n<ul>\n<li>Code cleanup to pass Plugin Check (prepared identifiers, input sanitizing,\nwp_parse_url). English readme.<\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>Immediate email alert to the administrator when a block is triggered (one\nemail per IP per hour, to avoid flooding the mailbox).<\/li>\n<li>Periodic report (daily \/ weekly \/ monthly) listing the blocked IP addresses\nwith full details. \"Send report now\" button.<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>First release: atomic TOCTOU \/ double-submit protection on front-end POST\nrequests, settings page, automatic cleanup.<\/li>\n<\/ul>","raw_excerpt":"Prevents TOCTOU attacks and double execution of POST requests.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/404779","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=404779"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/carlocozzetto"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=404779"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=404779"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=404779"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=404779"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=404779"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=404779"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}