Our latest patch version contains several critical security fixes, including one for an authentication bypass that let unauthenticated attackers use the API as another user. It also fixes several other issues around federation, private blogs, and access control. We recommend all admins update to this version as soon as possible.

This release also updates our Web Monetization support to the latest version of the standard, and includes a handful of bug fixes and improvements for users and admins.

Security

  • Critical: Fix authentication bypass via API access tokens (reported and fixed by @diaoqi129, GHSA-7jv7-gf23-wcqq)
  • Fix private and password-protected blog content exposed via the ActivityPub outbox (by @thebaer, reported by @awanawana, GHSA-cx5r-gg25-76ph)
  • Fix server-side request forgery (SSRF) via WebFinger lookups (by @thebaer, reported by @tikket1, GHSA-wvrr-gx9p-xvxm)
  • Fix unauthenticated SSRF via ActivityPub inbox actor / object resolution (by @thebaer, reported by @iaohkut-from-NightWolf-Team, GHSA-7635-vx4w-qww7)
  • Fix IPv6 transition address bypass of SSRF protections in federation (by @thebaer, reported by @tonghuaroot, GHSA-22qx-x758-m72p)
  • Add CSRF protection to account settings endpoints (/me and /api/me) (by @thebaer, reported by @hacktivat0r and coordinated by @u9000-Nine, GHSA-mp2f-3fq8-r9vj)
  • Enforce the maximum blogs per user limit when creating blogs via the API (by @thebaer, reported by @tonghuaroot, GHSA-g4m9-5p4q-ch24)
  • Prevent users from changing settings on another user's blog via the API (by @thebaer, reported by @N0el4kLs, GHSA-7mmq-gh5f-97p3)
  • Prevent users from changing metadata on blogs they don't own (by @thebaer, GHSA-wqc7-9ph9-m5fm)
  • Fix stored XSS via unsanitized post slugs in RSS, email, and ActivityPub output (by @thebaer, reported by @geo-chen, GHSA-cwxm-8ch5-j2vh)
  • Prevent users from pinning or unpinning other users' posts (by @thebaer, reported by @5ud0er, GHSA-hwfg-mg9c-cvgf)
  • Enforce signup checks consistently across all registration paths, extending the invite code validation from v0.17.2 to API and OAuth signups, by @thebaer in github.com/writefreely/writefr

User-Facing Changes

Admin-Facing Changes

Developer-Facing Changes

Dependencies and minor fixes

Upgrading from v0.17.x or earlier

  1. Download the latest release for your operating system and architecture
  2. Stop running your writefreely server
  3. Replace all files in your installation (except for the keys directory) with the ones in the archive
  4. (Only when upgrading from < v0.17.0) Update your database by running: writefreely db migrate
  5. Start your writefreely server again
  6. (Recommended) Revoke existing API access tokens, as described below

If you're upgrading from a much earlier version, follow the instructions in each previous release.

Recommended: revoke existing API access tokens

Upgrading closes the authentication bypass (GHSA-7jv7-gf23-wcqq), but doesn't invalidate API access tokens that already exist. As an extra precaution, in case any were exposed before you upgraded, we recommend revoking all existing tokens once your upgraded instance is running.

Doing this will sign all users out of apps and tools that use WriteFreely's API, such as mobile apps, command-line clients, and other integrations. They'll need to log in to those again. People signed in to WriteFreely on the web stay signed in.

There's no writefreely command for this, so you'll need to clear the accesstokens table directly. Use the database details from your config.ini:

SQLite

sqlite3 /path/to/writefreely.db "DELETE FROM accesstokens;"

MySQL / MariaDB

mysql -u <username> -p <database> -e "DELETE FROM accesstokens;"

Optionally, to invalidate web sessions, you can also regenerate your session keys using the steps below. This will require all users to log in again, and for readers to re-enter passwords for any password-protected blogs.

  1. Stop WriteFreely
  2. Back up your keys folder temporarily
  3. Delete keys/cookies_auth.aes256 and keys/cookies_enc.aes256 (do not delete keys/email.aes256)
  4. Run writefreely keys generate as the same user as your server
  5. Start WriteFreely again

Full Changelog: github.com/writefreely/writefr