Part of djust 1.2 — read the 1.2 release notes.
A 1.2 patch release that includes security fixes; upgrading from 1.2.6 is recommended.
Fixed
- The HTTP POST fallback no longer drops
push_event,set_layoutanddefer()(#3541). An event answered over HTTP carried only flash and page metadata. Its JSON answer now also carries_push_events({event, payload}perpush_event/push_commands) and_layout({path, html}forset_layout), anddefer()callbacks run after the answer is built, as on the WebSocket. The client dispatches each push event (djust:push_eventand thedj-hookhandlers) and applies the layout, as the WebSocketpush_event/layoutcases do. 10 regression cases inpython/tests/test_http_side_channels_push_layout_defer.py, plustests/js/http-side-channels-push-layout-3541.test.jsfor the client. - SSE pages ignored
set_layout(). The server sends thelayoutframe from the shared turn end, so it reaches SSE pages too, but the SSE transport had no case for it and dropped it as an unknown frame. It now swaps the layout as the WebSocket transport does. Covered bytests/js/sse_layout_frame.test.js, which runs on both transports. - Dependencies updated to patched versions. The locked Python packages (
certifi,msgpack,pyasn1,setuptools,twisted,autobahn), the Rust crates (pulldown-cmark,tokio) and the JavaScript dev tooling (vitest,happy-domand their dependencies) now resolve to releases that carry the fixes for their published security advisories. No djust code changed.
Security
- Credential form fields are no longer pre-filled from the stored value in
FormMixinstate. A form field is seeded empty when it is on the serialization floor and it is credential-like. On the floor means: a password-input field; the built-inpassword; a name listed inDJUST_SENSITIVE_FIELDSordjust_exclude_fields; a field outside adjust_serializable_fieldsallowlist; or a column of an excluded field type. Credential-like means: a password widget, a name such aspassword,token,secretorkey, or an excluded field type. A custom column that is not on the floor is unchanged: list it inDJUST_SENSITIVE_FIELDSto have it covered, the same as for{{ obj.field }}. On an edit form, a blank submission (absent, empty, whitespace-only,Noneor another falsy value) keeps the stored column, so clearing such a column now needs explicit code; a typed value still writes. Saved state from earlier versions is cleaned on restore, validation messages for these fields are generic, and after a validUserCreationFormsubmit the password fields in form state are empty. AFormMixinview with noform_classnow reads credential-like keys (token,key,pin,hash, ...) fromget_field_value()as empty. Sessions and snapshots written by earlier versions are not rewritten until their next save. Regression cases inpython/tests/test_form_data_sensitive_fields.py. - A native component handler uses an explicitly passed argument as given. The nine native handlers
data_table(rows,columns),breadcrumb,stepper,dj_select,dj_radio,autocomplete,dependent_select,toast_containerandform_errorsnow consult the render context for an argument only when it was not passed, so an explicit argument (including an empty one) wins over a context variable of the same name, as it does in the Python tag.toast_containernow also honours itstoasts=anddismiss_event=arguments. - Per-model serialization settings are honoured for lazily wrapped model instances.
djust_exclude_fields,djust_serializable_fields,djust_serialize_sensitive_fields, a model-levelto_dict()and the field-type exclusion (BinaryField) now apply to a model held in aSimpleLazyObjector another transparent object proxy the same way as to the bare instance. The wrapper is resolved once. - Custom tag handlers that resolve dotted names no longer see underscore-prefixed attributes of a model or queryset handle. The template handles for models and querysets now refuse single-underscore names (as template resolution already does) and keep the protocol names reachable. A handle can be copied with
copy/deepcopybut is no longer picklable: pickling a render context that holds one raisesTypeError. - Row-click navigation targets and mount URLs are normalised before they are checked. The data table's row navigation script and
validate_mount_urlnow apply the browser's URL normalisation (tabs and newlines removed, backslash read as a slash) before the same-site test, through one definition indjust.security.urls. Absolutehttp(s)row URLs are still followed.