Apostrophe 4.34.1: Security Fixes and Safer Content Operations

Author: Lindsay Ifill Published Estimated reading time: 3 min read

Last Updated

Apostrophe 4.34.1 fixes 17 security vulnerabilities, including a critical authentication bypass. Upgrade now. It also adds safeguards that protect your content.

Apostrophe 4.34.1 is out. This is a maintenance release with an important set of security fixes, including one critical and one high severity issue. We strongly recommend that all users upgrade as soon as possible. The release also protects your content in a few situations where it could be damaged or lost, and it fixes scheduled tasks on the Assembly dashboard.

Security fixes

This release fixes 17 security vulnerabilities across Apostrophe core, Import/Export, Form Builder, AI Helper, the Apostrophe Astro and sanitize-html. Most of them were responsibly reported by outside security researchers, and we’re grateful for their help.

The fixes cover:

  • A critical authentication bypass involving bearer tokens

  • Access control gaps that could let users see or edit fields and documents they shouldn’t have access to

  • Cross-site request forgery (CSRF) from sibling subdomains

  • Stored cross-site scripting (XSS) in JSX templates

  • sanitize-html bypasses in non-default configurations

  • Denial of service risks in core, Form and AI Helper

  • Hardening for Import-Export

Check these before you upgrade

A few of these fixes change behavior your project may depend on:

  • viewRole now also controls editing. A user who can’t view a type’s documents can no longer edit them.

  • Cross-origin requests from the same site are now rejected. If your frontend runs on a sibling subdomain, add it to the new allowedOrigins setting of the csrf option. Astro projects should update @apostrophecms/apostrophe-astro to 1.18.1 when they update core.

  • Fields protected by viewPermission are no longer added to the search index. If this applies to your site, run node app @apostrophecms/search:index after upgrading.

  • String props passed from JSX to Nunjucks blocks are now escaped.

Protecting your content

  • Duplicating a widget no longer removes content. Before this fix, duplicating a widget with a relationship to its own page could make other widgets in the same area disappear or lose recent edits.

  • Deleted modules no longer break the admin UI. Documents left over from a page or piece type you’ve removed no longer cause errors in the page tree, during upgrades or in version history.

  • Missing attachments no longer erase references. If the aposAttachments collection is missing, for example after a database restore that left it out, saving now stops with a clear error instead of silently removing the reference.

  • Undo restores the widget’s original state. With live preview turned on, undoing a widget edit now takes you back to how the widget looked before you opened the editor.

Assembly fixes

Scheduled tasks on the Assembly now run as expected. Note that --frequency must now be hourly or daily. In the Section Template Library, inserting the same section more than once no longer gives the inserted widgets duplicate ids.

Other improvements

  • Forms: Answers to conditional fields shown by a checkboxes field are no longer lost when the form is submitted. Required fields inside a hidden conditional group no longer block submission.

  • Media: Uploaded SVGs keep their embedded images. Uploading an image when a relationship is already full now replaces the most recent selection.

  • Editing: edit: false now locks nested areas too. Version history no longer lists “changes” between empty values. The CSRF cookie now lasts a year, as intended, instead of about nine hours.

  • For developers: Nested arrays and objects with the same name as their parent no longer cause a server error. This changes how array items and objects are matched to their schema, so check the release notes if your code uses arrayName, objectName or apos.schema.getArrayManager.

Thanks to everyone in the community who reported issues and contributed fixes this month. You’ll find them credited in the release notes.

How to update

Run npm update in your project. If any of the changes under “Check these before you upgrade” apply to you, review them first.

For the full changelog, security advisory details and reporter credits, see the full release notes.

Let us know what you think on our roadmap.