Skip to content

XMF 1.3.4 Beta1

Pre-release
Pre-release

Choose a tag to compare

@mambax7 mambax7 released this 02 Nov 20:42
· 31 commits to master since this release
bc83400

XMF 1.3.4 Beta 1

A security-hardening pre-release for the PHP 8.2+ line (^8.2, tested on 8.2–8.5). It closes filtering bypasses, a SQL identifier injection surface, several denial-of-service paths and an HTML-injection gap in Highlighter. There are no new features. A few methods now reject input they used to accept, so check Upgrade notes before you deploy.

This is a beta: please test it against your modules and report regressions at https://github.com/XOOPS/xmf/issues.

Upgrade notes (behaviour changes)

  • Database\Tables::executeQueue() refuses unforced writes on GET requests again (core allowWebChanges false), as it did before 1.3.1. Migrations that run from a GET page must call executeQueue(true).
  • Database\Tables / TableLoad quote every table, column and index name with backticks. A name that is not a string or int throws InvalidArgumentException. An index prefix length must be numeric (name(20)).
  • Database\Migrate throws SchemaDefinitionException for an empty key column entry.
  • FilterInput WEBURL rejects more values: backslashes, entity-hidden schemes (javascript:), http/https URLs with no host, and authorities containing & or %. Values that were never valid URLs in a browser's reading may now come back empty.
  • FilterInput arrays are filtered at every depth. Arrays nested deeper than 32 levels are dropped.
  • Security\Serializer::toJson() rejects data whose JSON form would exceed 5,000,000 bytes.
  • Module\Helper::getHandler() accepts only names made of letters, digits and _.
  • Debug::startTrace() refuses to start when the installed Xdebug cannot honour the requested $collect_params / $collect_return settings, rather than recording more than you asked for.
  • Yaml::read() / readWrapped() stop at 2 MB of data read, not just reported file size.

Security

  • FilterInput
    • Nested array values are filtered (they were returned unfiltered).
    • clean() uses the calling class's own instance, so a subclass's policy no longer leaks into later FilterInput::clean() and Request calls.
    • WEBURL reads the scheme the way a browser does. javascript:1/alert(1) and data:80/... are rejected, as is //host (decodes to //host) (#200).
    • Tag filtering runs in linear time. A ~1.4 MB value used to take over 20 seconds per pass (#203).
  • SQL identifiers. Tables and TableLoad quote caller-supplied names. TableLoad::countRows() / extractRows() / truncateTable() and Tables::dropIndexes() used to pass them through unquoted. INFORMATION_SCHEMA lookups use string literals (#201).
  • Serializer. toJson() budgets the encoded size before calling json_encode(). This counts shared references, JsonSerializable results, string bytes, keys, backed enums, ArrayObject / ArrayIterator contents and PHP 8.4 property-hook values. A few hundred bytes of crafted serialized data could exhaust memory before (#204, #208).
  • Highlighter
    • A > inside a quoted attribute no longer ends the tag, so terms are never highlighted inside attributes.
    • Comments, declarations and <?...> sections are left alone (#204, #208).
  • SendmailRunner. A symlinked sendmail path runs only when every parent directory is owned by root or the PHP user and is not group- or world-writable. Otherwise the validated canonical target runs (#204).
  • Module\Helper. getHandler() can no longer include PHP files outside the module's class/ directory (#204).
  • Debug. startTrace() fails closed instead of tracing full parameter or return values against the caller's request (#204, #208).
  • SerializableTrait. Control characters are escaped in migration failure logs, so one failure is one log line (#204).
  • Metagen. getSearchSummary() searches duplicate terms once (#204).

Bug fixes

  • Highlighter::apply(): empty search terms no longer loop until memory runs out.
  • Debug: first use no longer re-enables Kint after the application disabled it.
  • Database\TableLoad::countRows() returns 0 on a failed query instead of raising a warning.
  • Database\Migrate:
    • Key column lists are normalized to the form getTableIndexes() reports, so unchanged indexes are no longer dropped and recreated on every run.
    • Column names containing a double quote survive the CSV round trip.
  • Database\Tables::addPrimaryKey() accepts a prefix length (code(8)), like addIndex().

Infrastructure

  • CI: shivammathur/setup-php 2.40.0 (#199), SonarSource/sonarqube-scan-action 8.4.0 (#202).
  • FileStorageTest uses a private temp directory.

Pull requests

#199, #200, #201, #202, #203, #204, #208

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