Skip to content

5.22.2 20260826 - #3231

Open
FrankApiyo wants to merge 7 commits into
mainfrom
5.22.2-20260826
Open

5.22.2 20260826#3231
FrankApiyo wants to merge 7 commits into
mainfrom
5.22.2-20260826

Conversation

@FrankApiyo

@FrankApiyo FrankApiyo commented Aug 25, 2026

Copy link
Copy Markdown
Member

Changes / Features implemented

Release branch for 5.22.2 (2026-08-26). Contains seven commits: SQL injection hardening in DataView chart/stats filters and related raw-SQL sinks (widget group_by, data view filters, stats alias, $or null-value handling in get_where_clause), three encryption fixes (preserving managed encryption status and encrypted submission ciphertext when rebuilding or reconfiguring forms, and trigger-list coercion when rebuilding surveys from JSON), and the pinned-dependency minor bumps also proposed in #3230.

Steps taken to verify this change does what is intended

Full CI (unit tests, static analysis, security scans) passes on this branch content, and the Docker image builds successfully for amd64 and arm64.

Side effects of implementing this change

The dependency bump commit overlaps with #3230; merging either first leaves the other a trivial rebase.

Before submitting this PR for review, please make sure you have:

  • Included tests
  • Updated documentation (N/A)

Closes #


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

kelvin-muchiri and others added 7 commits July 29, 2026 12:10
The $or branch interpolated an attacker-controlled JSON key directly
into the raw SQL WHERE fragment via an f-string when the key's value
was null, while every sibling branch binds it with %s. Bind the key
as a parameter, matching the existing IS NULL handling in _parse_where.
 fix: parameterize DataView filter SQL and allow-list query columns

  Bind DataView filter column and value as query parameters instead of
  interpolating them into SQL, removing the %s-shift injection that bypassed
  the prior single-quote escaping. _additional_data_view_filters returns
  (fragment, params), the _postgres_* builders thread params through a
  %(additional_filters)s placeholder, and _execute_query binds them via
  cursor.execute(query, params).

  As an independent second layer, validate query[].column in DataViewSerializer
  against the form's field XPaths plus the metadata columns filtering treats as
  first-class (adds _date_modified, _submitted_by, _duration). Reject unknown
  columns, non-strings, and the Django lookup separator __; get_filter_kwargs
  drops the same unsafe columns at the consumption boundary so DataViews created
  directly or already stored cannot reach filter(**kwargs) with a column that
  escapes the json key boundary.
…3197)

Creating a merged dataset from forms that use a trigger column failed
with a PyXFormError because the processed trigger tuple is stored as a
list in the form JSON and pyxform rejected the list when rebuilding the
survey.
…LSForm (#3191)

* Managed encryption and updating the public key via the API injects the public key into a form's stored json after publishing; the XLSForm file has no record of it. When parsing stale pre-pyxform-4.1.0 json fails and _get_survey  falls back to rebuilding from the XLSForm, the rebuilt survey lost the key and a full save recomputed encrypted field as False. Re-inject the form's public_key into the rebuilt survey and workbook json

* Data migration logger.0039_restore_flipped_encryption restoring already-flipped forms
… off (#3206)

Encrypted envelopes received while a managed form's encrypted flag is
False - flipped by the stale-json bug repaired in logger.0039, or after
encryption is disabled while devices still hold an encrypted version -
were not recognised by get_expected_media, so the attachment sweep
soft-deleted their ciphertext right after creation and decryption
failed with no files.

Recognise encrypted envelopes whenever the form is or was under managed
encryption, parse lone media nodes as lists under the same predicate,
mark such submissions pending decryption, and add a data migration that
restores swept ciphertext and decrypts the affected submissions.
#3232)

* Updates all pinned Python dependencies to their latest minor and patch releases

* Closes the known security advisories in the previous pins:

Django: CVE-2026-48588, CVE-2026-53877, CVE-2026-53878
cryptography: CVE-2026-69247
Pillow: CVE-2026-54058, CVE-2026-54059, CVE-2026-54060, CVE-2026-55379 and others
sqlparse: CVE-2026-54284, CVE-2026-59893, CVE-2026-59894, CVE-2026-71491
pyasn1: CVE-2026-59884, CVE-2026-59885, CVE-2026-59886
httplib2: CVE-2026-59939
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants