diff --git a/CHANGELOG.md b/CHANGELOG.md
index da2d0e34d..44442411e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -40,6 +40,7 @@ Update from Maintenance > Update as usual. This release has four database change
- Email and phone links work in Knowledge Base articles and documents - a `mailto:` or `tel:` link showed as plain text on the published article, in the client portal and on the document, while the editor still had it. Those in an article or document written in Markdown were taken out when it was saved; the database update puts them back in the ones already saved, so they don't need saving again. Email and phone links in ticket replies, such as those in an email signature, work too.
- Opening one of your own vendors from a client's license or service works - it said there was nothing to see.
- A ticket's other assets show on it when its main asset was taken off - they were still on the ticket but not listed.
+- Behind CrowdSec's web application firewall, creating a ticket or a recurring ticket got you blocked, and soon banned, whatever you wrote in it. CrowdSec took the names of the fields that book the work - when, for how long, remote or onsite - for a Linux command, as they began with "sched", and so blocked the post. The same stopped the ticket's Schedule window, adding an agent to help at their own time, the **Scheduled** tab of the tickets list, sorting Maintenance > Cron by **Schedule** and saving a cron job. Those fields have new names, so nothing needs excluding in CrowdSec: any exclusion you added for this can come out. Stripe's return to ITFlow after a client saves a card or sets up autopay is renamed too, as the same firewall can take it for an attack when the browser doesn't say where it came from.
### Developer Updates
@@ -60,6 +61,7 @@ Update from Maintenance > Update as usual. This release has four database change
- Vendors permission: `module_vendor` (database 4.4.6, module 9 on a fresh install, `setup/seed_data.php` - Technician Read, Accountant Full); 4.4.6 gives every role `max(1, its module_financial level)`. In `functions/vendor.php`, `vendorPermissionReady()` (4.4.6) switches `vendorModule(0)` from `module_financial` to `module_vendor`, and `vendorCan(0, 1)` from always-yes to the permission; `vendorEnforce(0, $level)` enforces it at every level. `vendorIsOurs($vendor_id)` (one query a page) and `vendorCanOpen($vendor_id)` decide whether a mention of a vendor opens: `vendorLink()` and the new `vendorNameHtml()` show the name without a link, and `vendorRedact($row, $vendor_id)` blanks a row's `vendor_phone`, `vendor_account_number`, `vendor_code`, `vendor_email`, contacts and hours - used by `agent/network.php`, `agent/license.php`, `agent/ticket.php`, `agent/service.php` and the network, license and service quick looks. `vendorLink()` no longer puts a client's id on a page link to one of ours. The ours list (`agent/vendors.php`), its export, the vendor quick look and global search's Vendors group check it; the side nav's Vendors goes to `vendors.php?view=clients` without it. `roleModules()` lists modules in `roleModuleInfo()`'s order, then by id.
- Linked assets: `asset_links` (database 4.4.7) keeps each link as two rows, (`asset_id`, `linked_asset_id`) and the reverse, both `ON DELETE CASCADE`. `functions/asset_link.php` has `assetLinksReady()` (4.4.7), `assetLinked($asset_id)` (the client's assets, not archived), `assetLinkedNames($asset_ids)` for a list in one query, `assetLinkedTo()`, `assetLinkAdd($asset_id, $ids)` and `assetLinkRemove($asset_id, $other_id)` - each writes an `asset_history` row on both sides and `logAudit('Asset', 'Link')` or `'Unlink'` - and `assetLinkedListHtml()` for the card. The link picker (`functions/link_picker.php`) takes `asset|asset` in `LINK_PICKER_OWN`, with Support at Modify; it is kept out of `LINK_RELATIONS`, whose code assumes two different kinds. `agent/post/asset.php` adds `unlink_asset_link` and `move_linked_asset`, which sets one asset's location to the other's through `assetQuickSet()`, and `bulk_transfer_client_asset` copies the links between the assets it moves to their new copies. `clientExportLinks()` lists each pair once.
- Ticket assets: New Ticket, Edit Ticket, `agent/modals/ticket/ticket_edit_asset.php` and both recurring ticket windows post one `assets[]` multi-select, an `assets_form` marker and `asset_main`, in place of `asset_id` (`asset` in the Assets window) and `additional_assets[]`. The tables are unchanged. `ticketAssetsPosted($client_id, $main_field)` (`functions/ticket.php`) reads it - the client's own in the order posted, `asset_main` kept as `ticket_asset_id` while it is picked, else the first, the rest to `ticket_assets` - and still reads the old fields. `ticketAssetsSave()` writes both and notes the assets added and removed in `ticket_history`; `ticketOtherAssetIds()` lists the others by name; `ticketAssetsFieldHtml()` draws the field for the edit windows. `agent/js/tickets_add_modal.js` fills one `#assetSelect` and keeps the first asset picked in `#assetMain`. `remove_ticket_asset` (`delete_ticket_additional_asset` still works) takes the main asset off too, the first of the others by name taking its place. The tickets list search also looks through `ticket_assets`, and the ticket quick look (`agent/modals/ticket/ticket.php`) lists them.
+- Field and parameter names CrowdSec's copy of the OWASP Core Rule Set blocks: the `appsec-crs` collections install CRS 4.0.0-rc1 from crowdsecurity/sec-lists, whose rule 932260 matches `sched` at the start of any argument's name or value (upstream CRS has dropped it as a false positive). Renamed: New Ticket's `schedule` and `schedule_minutes` to `book_at` and `book_minutes`, which Dispatch's link to it uses too; the Schedule window's `scheduled_date_time`, `schedule_tech` and `schedule_minutes` to `book_at`, `book_agent` and `book_minutes`; the helper window's to `book_at` and `book_minutes`; recurring tickets' `schedule_time`, `schedule_minutes` and `schedule_onsite` to `book_time`, `book_minutes` and `book_onsite` (`agent/includes/inc_recurring_ticket_ahead.php`); the cron job window's `schedule` to `job_schedule`; the tickets list's `show=scheduled` to `show=booked`; and Maintenance > Cron's `sort=schedule` to `sort=when`. Stripe Checkout's return URLs carry `checkout={CHECKOUT_SESSION_ID}` in place of `session_id`, which rule 943120 blocks when there is no Referer (`guestCheckoutSessionId()` in `guest/guest_post.php`). Each handler and page still reads the old name. Every field name, URL parameter and link value in the code was put through CrowdSec's Coraza fork (v3.8.1-crowdsec.20261110) with its CRS 4.0.0-rc1 and 4.31.0 at paranoia level 1, and nothing else matches. CONTRIBUTING.md has the rule.
## [26.12.5]
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 89a21c8d3..ec95daa5d 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -272,6 +272,8 @@ Two standing exceptions: junction tables (`client_tags`, `service_assets`, …)
**Read an uploaded CSV through `csvTextToUtf8()`.** Excel's plain CSV is Windows-1252 on Windows and Mac Roman on a Mac, and its Unicode Text is UTF-16. Read raw, an accented letter turns into `?` at the first `mb_substr()`, or breaks `json_encode()` outright. `importFile()` does it for the Import window. Anything reading `$_FILES` itself puts the text through `csvTextToUtf8()` and `fgetcsv()`s it from `php://temp`, as `expenseImportRead()`, `agent/post/network_ip.php` and `agent/post/asset_interface.php` do. `escapeSql()`'s Windows-1252 fallback works on one value at a time, so it can't tell a Mac file from a Windows one.
+**Don't start a field name, or a value in an address, with a Unix command's name.** CrowdSec's web application firewall runs its own copy of the OWASP Core Rule Set - the `appsec-crs` collections install CRS 4.0.0-rc1 from crowdsecurity/sec-lists - whose rule 932260 blocks a request when any field or URL parameter's name or value starts with a command on its list, and bans whoever sends a few. `sched` is on it, so a field named `schedule_minutes` blocked every new ticket. The booking fields are `book_at`, `book_minutes`, `book_onsite`, `book_time` and `book_agent`, the tickets list's tab is `show=booked` and Maintenance > Cron sorts by `when`. Before using a name that starts with a word like that, check it against `appsec/crs/4.0.0-rc1/REQUEST-932-APPLICATION-ATTACK-RCE.conf` in that repo. What an editor holds is a separate case - it goes as a file beside the form (`itflowFields` in `js/http.js`).
+
**Schema changes require two edits in one PR:**
1. `db.sql` — so fresh installs get the new schema.
diff --git a/admin/cron.php b/admin/cron.php
index 5b37ca537..7d22b1262 100644
--- a/admin/cron.php
+++ b/admin/cron.php
@@ -16,8 +16,9 @@
* there is nothing to change about it until cron has run once.
*/
-// The list: by schedule until a heading is clicked - the every-minute jobs, then the day's in the order they run
-$sort = "schedule";
+// The list: by schedule until a heading is clicked - the every-minute jobs, then the day's in the order they run.
+// Its key is when, not schedule: a web application firewall takes a value starting sched for the Unix command.
+$sort = "when";
$order = "ASC";
require_once "includes/inc_all_admin.php";
@@ -233,23 +234,26 @@ $command_block = function () use ($cron_command) {
};
$owner_note = $file_owner !== '' ? ' (' . escapeHtml($file_owner) . ' here)' : '';
-// The list - only these sort; anything else asked for falls back to the schedule
+// The list - only these sort; anything else asked for falls back to the schedule (schedule is when's name from before)
+if ($sort === 'schedule') {
+ $sort = 'when';
+}
$sort_keys = [
'job' => function ($job) { return strtolower($job['label']); },
- 'schedule' => function ($job) { return $job['schedule'] === 'Daily' ? 100000 + intval(substr($job['daily_at'], 0, 2)) * 60 + intval(substr($job['daily_at'], 3, 2)) : $job['interval_minutes']; },
+ 'when' => function ($job) { return $job['schedule'] === 'Daily' ? 100000 + intval(substr($job['daily_at'], 0, 2)) * 60 + intval(substr($job['daily_at'], 3, 2)) : $job['interval_minutes']; },
'last_run' => function ($job) { return $job['last_run_at'] ? strtotime($job['last_run_at']) : 0; },
// What needs a look first
'status' => function ($job) { return array_search($job['state'], ['failed', 'lost', 'queued', 'running', 'paused', 'skipped', 'never', 'completed', 'unused'], true); },
];
if (!isset($sort_keys[$sort])) {
- $sort = 'schedule';
+ $sort = 'when';
}
uasort($jobs, function ($a, $b) use ($sort_keys, $sort, $order) {
$compared = $sort_keys[$sort]($a) <=> $sort_keys[$sort]($b);
return ($order === 'DESC' ? -$compared : $compared) ?: $a['position'] <=> $b['position'];
});
// A heading sorts its own way round first - names A to Z, the latest run and what needs a look at the top - then the other
-$sort_first = ['job' => 'ASC', 'schedule' => 'ASC', 'last_run' => 'DESC', 'status' => 'ASC'];
+$sort_first = ['job' => 'ASC', 'when' => 'ASC', 'last_run' => 'DESC', 'status' => 'ASC'];
$sort_link = function ($column, $label) use ($sort_first) {
return sortLink($column, $label, $sort_first[$column] ?? null);
};
@@ -387,7 +391,7 @@ $status_looks = [