Skip to content

XMF 1.3.4 RC1

Pre-release
Pre-release

Choose a tag to compare

@mambax7 mambax7 released this 11 Nov 05:00
· 7 commits to master since this release
900e65c

XMF 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() returns false for a stored object, enum or non-string value, and set() throws for a value get() 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 uses http, https or mailto. Attributes with data:, tel:, ftp: or other schemes are removed. This applies to Request calls with MASK_ALLOW_HTML too.
  • 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 a noscript holding 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_classes alone 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 and null at their encoded length in the size guard (#212).
  • 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).
  • FilterInput. URL attributes on allowed tags accept only safe schemes, so allowed tags can no longer carry data: links. Only srcset and imagesrcset are split at commas, so a single URL such as /docs/a,b:c is kept (#222).
  • Metagen
    • Plain text built from HTML has tags removed again after entities are decoded, so encoded markup (&amp;lt;b&amp;gt;, &#x3c;svg&#x3e;) no longer comes out as a live tag in a summary a template prints unescaped. Text such as x <5 is kept (#215).
    • getSearchSummary() caps the number of search terms (#215).
  • 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 and null was 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 of AUTO (#221).

Infrastructure

  • CI: SonarSource/sonarqube-scan-action 8.4.1 (#225).

Pull requests

#212, #215, #221, #222, #225

Full Changelog: v1.3.4-Beta1...v1.3.4-RC1