Persona - Personalise Your Forum Identity

Persona - Personalise Your Forum Identity 1.3.3

No permission to download
Hey, appreciate the detailed write-up. You were right on all counts.

v1.3.0 is up now and covers everything you flagged:

  • Font fields are validated against the known font list (Google Fonts + any custom fonts added by the admin). Arbitrary text no longer gets through.
  • Gradient direction, border styles, text transforms, icons, and shapes all go through strict allowlists now. Invalid values get silently replaced with defaults.
  • Colour fields are regex-validated (hex, rgb/rgba, hsl/hsla only).
  • The block check and tier enforcement are both in the core save method now, so import, copy, revert, and reset all respect them. No more bypasses through those routes.
  • Font names get sanitized before they hit the link tag in the listener as well, so even if something slipped past the save validation it wouldn't render as HTML.
Good catch on the tier bypass through import/copy -- that one was easy to miss since the UI enforces it visually but the backend didn't on those paths. Fixed now.

Thank you 😊
My pleasure, glad I was helpful and you could get a new build out! I'll analyze this one as well and get back to you with my findings if any. If you don't want me doing this on your add-on, feel free to let me know and I'll stop ;)
 
I installed 1.3.0 on a throwaway test forum and re-ran the actual exploits, and the six I reported are genuinely closed:
  • The username-font and title-font XSS: both crafted values are rejected against the font allowlist now (and stripped again at the render sink as defense-in-depth) - re-ran both, no execution.
  • The gradient-direction / style-token CSS injection: allowlisted, the breakout value drops to the default - confirmed no rule injection.
  • The colour fields: regex-validated (anchored), good.
  • The tier + block checks in the core save method: I could no longer equip a premium frame via import (themes go through the identical unconditional re-validation right beside it), and a blocked user can no longer restyle via import (got a permission error) - both fixed.

Nicely done. A few follow-ups from a deeper pass - one residual security item, then some performance/quality things you can take or leave. All re-tested on 1.3.0, all in Persona itself.

1. The tier fix is complete for frames and post themes, but name badges can still be bypassed via import (medium).
Frames and post themes get re-validated unconditionally in the save method now. But the badge re-validation only runs when the multi-badge field is non-empty, and the older single-badge id column is never tier-checked - not in the save method, and not at render (the render helper filters on active only, and falls back to the single-badge id when the multi field is empty). Because an empty string counts as "empty" in PHP, a free user can send an import with an empty multi-badge field plus a single premium badge id, skip the re-validation, and the premium badge persists and renders.
  • Verified: as a plain Registered member I imported a payload equipping the Pro-tier "Elite" badge; it saved and rendered next to my username on posts/profile - a paid badge on a free account.
  • Same pattern, minor/latent: the save-time re-validation checks tier but not seasonal availability - the picker enforces the date window, the import path doesn't - so if you ever date-gate an item, it'd be equippable out of its window via import. Your default seasonal items don't set a window, so it's not currently exploitable; just worth closing alongside the badge fix.
  • Fix: tier-check (and seasonal-check) the single-badge id in the save method regardless of the multi field - or normalise an empty/"0" multi field to an empty array before the re-validation runs - and/or re-check at render in the badge helper.

2. Latent DOM XSS in the profile music/video embeds - not currently firing, but worth fixing when you fix the embeds (low now, high later).
Your URL sanitiser blocks javascript:/data: and requires http(s), but it keeps angle brackets and quotes (the URL filter it uses doesn't strip them, and it then decodes HTML entities), and the client-side embed builder inserts the stored URL into the iframe/anchor markup by string concatenation (innerHTML). So a stored profile music URL that begins with the allowed domain but continues with markup closing the src attribute survives the sanitiser and would break out when the embed is built.
  • Tested caveat: on a stock XenForo 2.3.10 install the embed block never actually renders - the injector looks for a member-header link carrying a user-id attribute, and stock XF's member header doesn't have one, so the embeds silently don't display at all. So this is NOT currently exploitable on stock XF (I confirmed the payload stored but never executed) - but it's a functional bug (embeds don't show), and it becomes a real DOM XSS the moment you fix the render.
  • Fix: when you get the embeds rendering, strip/encode angle brackets and quotes in the sanitiser, and set the iframe src as a DOM property rather than building the markup by string concatenation.

3. Performance - the biggest practical one.
On every public page load (guests included), the listener runs unbounded full-table scans of all user styles and all badges (plus fonts and ranks) into PHP memory, with no caching, and emits per-user CSS links site-wide. On a small forum it's fine, but it'll scale poorly as the number of styled users grows - every page pays the cost. Worth caching the assembled output (registry/simple cache, rebuilt on save) and/or only loading the configs actually needed for the usernames on the current page.

4. Minor / packaging.
  • The 1.3.0 archive ships several .bak files inside the add-on (older copies of the listener and repository, including pre-fix versions), so old source ends up in the deployed tree - worth excluding *.bak from the build.
  • The admin custom-font upload throws a fatal (it calls a move method that doesn't exist on the upload object), so that feature doesn't work / nothing is written - and when you wire it up it'll need validity + extension/size checks.

A couple of smaller XF-convention things (using XF's JS framework for the injected scripts instead of raw script blocks, moving user-facing strings to phrases, atomic counter updates) I'll leave out of here - happy to walk through them privately if useful, no worries either way.

Everything above is from the shipped 1.3.0 source on a local test install; glad to share exact repro for the badge one. Really appreciate how fast you turned the fixes around - the core issues are solidly closed.
 
Is it possible to enable it only for certain groups?
Yep! As of 1.3.1 it uses XenForo's built-in permission system. Head to Groups & permissions > User group permissions in the admin panel and you'll see a "Can use Persona" option. Just set it to Allow for the groups you want, and leave it on No or Never for the rest.

Styles already applied will still show for everyone -- users without the permission just won't be able to edit or create new ones.
 
Brad P updated Persona - Personalise Your Forum Identity with a new update entry:

Persona v1.3.1

Permission support -- Persona now uses XenForo's built-in permission system. You'll find a "Can use Persona" option under Groups & permissions in the admin panel. Set it to Allow for the groups you want, No or Never for the rest. Styles already applied keep displaying; users without the permission just can't edit or create new ones.

Also in this update:

  • Fixed an issue where rainbow, shimmer, and colour-cycle effects could freeze on certain styles
  • Custom font uploads no longer...

Read the rest of this update entry...
 
Is it possible to enable it only for certain groups?
Yep! As of 1.3.1 it uses XenForo's built-in permission system. Head to Groups & permissions > User group permissions in the admin panel and you'll see a 'Can use Persona' option. Just set it to Allow for the groups you want, and leave it on No or Never for the rest. Styles already applied will still show for everyone -- users without the permission just won't be able to edit or create new ones.
 
Brad P updated Persona - Personalise Your Forum Identity with a new update entry:

Persona v1.3.1

This update adds user group permission configuration and style-agnostic support.
  • ACP Configurable Permissions: The Persona permission (canUsePersona) is now fully integrated with XenForo's built-in user group permissions. Head to Groups & permissions > User group permissions in the Admin CP to configure which groups are allowed to manage their forum identity styling.
  • Style-Agnostic Support: Persona styling is now style-agnostic and will...

Read the rest of this update entry...
 
Hello, would you consider allowing admins to limit the options available to members?

Example: Allowing members to customize their usertitle, but not their username.
 
Brad P updated Persona - Personalise Your Forum Identity with a new update entry:

Persona 1.3.2

This update addresses the request from @Hdlr to allow administrators to control exactly which styling options are available to specific user groups.

Granular Identity Permissions Administrators can now toggle individual customisation features on or off per user group under Groups & permissions > User group permissions > Persona:

Can use Persona (master permission)
Can customize username styling
Can customize user title
Can customize avatar frame & glow
Can customize...

Read the rest of this update entry...
 
I have noticed since installing the new update that it is now showing the Persona option over the default username CSS. Is this caused by something I have set, or something that happened within the add-on? I have attached a screenshot of what I am seeing over at chat-addicts.net

I see this in the post itself, profile view and also in the forum view. Thanks.

1789593755770.webp
 
Hi Brad. Thank you for the add on. The feedback has been a great. There is one thing I wanted to bring to your attention.

This user disabled other people's styles, but in doing so it moved his name to the middle on mobile. Also, I noticed that anyone who customizes their profile (avatar or usertitle) gets their name moved to the middle on mobile. The ones without customizations stay to the left on mobile, which is why it's strange that this particular user has this issue.
 

Attachments

  • Persona 2.webp
    Persona 2.webp
    58.9 KB · Views: 3
Brad P updated Persona - Personalise Your Forum Identity with a new update entry:

1.3.3 Native User Group Styling & Mobile Layout Improvements

What's New & Fixed in 1.3.3:

1. Native Group Styling & Permission Enforcement

  • Permission Checks in CSS Compilation: Persona now verifies the customizeUsername user group permission during CSS generation. If an administrator disables username customization for a user group, Persona suppresses all custom username rules, allowing native XenForo group styling (.username--styleX) to render without interference.
  • Default (Group Styling)...

Read the rest of this update entry...
 
@Shortie861 @Hdlr Thank you both for the detailed feedback. I have just published Persona 1.3.3 which resolves both issues:

1. Native Group Styling & Granular Permission Checks (for Shortie861):
  • In previous versions, custom username rules could override XenForo's native group CSS (.username--styleX) even if the customizeUsername permission was revoked.
  • 1.3.3 checks user group permissions during CSS regeneration. If customizeUsername is disabled, Persona suppresses all username CSS overrides and lets XenForo group styling take full precedence.
  • Added a third "Default (Group Styling)" option in the customizer alongside Solid and Gradient, plus a dedicated "Reset Username to Default" button, allowing members to keep forum group colors while still customizing avatar frames, titles, or badges.

2. Mobile Alignment (for Hdlr):
  • Centering rules have been scoped strictly to desktop viewports (min-width: 651px) and only apply if a member has active effects or mood pills that require centering.
  • On mobile (max-width: 650px), usernames and mood pills respect XenForo's native left-aligned horizontal layout.
  • Removed broad centering rules from the thread_view template modification so members who only customize an avatar or user title are no longer centered on mobile.

Upgrading via your XenForo Admin CP automatically runs the CSS regeneration step across all existing profiles.
 
Back
Top Bottom