Repository navigation
XMF 1.3.4 RC1
Pre-releaseXMF 1.3.4 RC 1
Release candidate for the PHP 8.2+ line (^8.2, tested on 8.2–8.5). It contains everything in 1.3.4 Beta 1 plus a second round of hardening in Serializer, Highlighter, FilterInput, Metagen and SendmailRunner. There are no new features, no new dependencies and no changed method signatures. A few methods now reject input they used to accept, so check Upgrade notes before you deploy.
If no regressions are reported, this code becomes 1.3.4, the version planned for XOOPS 2.7.5. Please test it against your modules and report problems at https://github.com/XOOPS/xmf/issues.
Upgrade notes (behaviour changes since Beta 1)
Security\Serializer(fromPhp(),fromLegacy(),from(),tryFrom()) rejects a payload that contains an object, a custom-serialized class or an enum whose class is not in the allowed classes (none by default). Such a value used to come back as__PHP_Incomplete_Class. Data that holds only scalars and arrays is not affected.Module\Helper\Session:get()returnsfalsefor a stored object, enum or non-string value, andset()throws for a valueget()could not read back. Store arrays and scalars.FilterInput: when tags are allowed, URL attributes (href,src,srcset,action,formaction,poster,xlink:href,dynsrc,lowsrc, …) keep a value only when it is relative or useshttp,httpsormailto. Attributes withdata:,tel:,ftp:or other schemes are removed. This applies toRequestcalls withMASK_ALLOW_HTMLtoo.Highlighter::apply()highlights at most 32 distinct terms, and a term repeated in another case counts once. Text after an<svg>or<math>start tag, after script text holding<!--, or after anoscriptholding markup is left unhighlighted.Metagen::getSearchSummary()looks for the first 32 distinct search terms only.Mail\SendmailRunner::deliver()runs a symlinked sendmail path as given only when every link in its chain sits in a directory owned by root or the PHP user and closed to group and other writes. Otherwise the validated canonical target runs, as before.
The Beta 1 upgrade notes still apply: Database\Tables::executeQueue() refuses unforced writes on GET requests, identifiers are backtick-quoted, FilterInput WEBURL is stricter, Module\Helper::getHandler() accepts only letters, digits and _, and Yaml reads stop at 2 MB.
Security
- Serializer
- Object, class and enum tokens are refused before
unserialize()runs.allowed_classesalone still autoloaded an unlisted enum class on PHP 8.1+ (#221). - Declared lengths past the end of the payload are rejected (#221).
- Binary strings such as
random_bytes()output now round-trip; the blanket NUL-byte rejection is replaced by the token check (#221). toJson()counts numbers, booleans andnullat their encoded length in the size guard (#212).
- Object, class and enum tokens are refused before
- Highlighter
- Markup is read as a browser's HTML tokenizer reads it. Raw text elements (
script,style,textarea,title, …) are skipped to their end tag, and a quote opens an attribute value only right after=. A highlight can no longer land inside an attribute and turn inert markup there into a live tag (#222). - Each text segment is highlighted in one pass, so the cost grows linearly with the number of matches (#212).
- Repeated terms are highlighted once and the number of terms is bounded (#222).
- Markup is read as a browser's HTML tokenizer reads it. Raw text elements (
- FilterInput. URL attributes on allowed tags accept only safe schemes, so allowed tags can no longer carry
data:links. Onlysrcsetandimagesrcsetare split at commas, so a single URL such as/docs/a,b:cis kept (#222). - Metagen
- Plain text built from HTML has tags removed again after entities are decoded, so encoded markup (
&lt;b&gt;,<svg>) no longer comes out as a live tag in a summary a template prints unescaped. Text such asx <5is kept (#215). getSearchSummary()caps the number of search terms (#215).
- Plain text built from HTML has tags removed again after entities are decoded, so encoded markup (
- SendmailRunner. Every link in the path chain (
/usr/sbin/sendmail→/etc/alternatives/mta→ …) and every directory a..leaves is checked, not just the first link (#215).
Bug fixes
Highlighter::apply()returns the highlighted body for long input. About 40 KB or more of text outside tags exhausted the PCRE JIT stack andnullwas returned (#212).Highlighter::apply()keeps invalid UTF-8 byte for byte; it was replaced by?(#212).Security\Serializer::detect()recognizes a plain or base64 enum payload as PHP or legacy format instead ofAUTO(#221).
Infrastructure
- CI:
SonarSource/sonarqube-scan-action8.4.1 (#225).
Pull requests
Full Changelog: v1.3.4-Beta1...v1.3.4-RC1