Skip to content

FOUR-32745: Prevent stored XSS in user directory - #9019

Open
eiresendez wants to merge 3 commits into
developfrom
task/FOUR-32745-user-profile-xss
Open

FOUR-32745: Prevent stored XSS in user directory#9019
eiresendez wants to merge 3 commits into
developfrom
task/FOUR-32745-user-profile-xss

Conversation

@eiresendez

Copy link
Copy Markdown
Contributor

Issue & Reproduction Steps

A low-privilege user can bypass the single-pass profile sanitizer with nested HTML, store executable markup in user profile fields, and trigger it when an authorized user opens /admin/users.

  1. Update firstname, lastname, or title through PUT /api/1.0/users/{id} using a nested HTML payload.
  2. Retrieve the stored user and observe that the payload has become executable markup.
  3. Open /admin/users as a user with directory access.
  4. Observe that the stored payload executes in the viewer's session.

Solution

  • Validate firstname, lastname, and title as plain text before persistence.
  • Require edit-personal-profile and enforce a profile-field allowlist for non-administrative self-service updates.
  • Keep username and password changes protected by edit-user-and-password.
  • Send only profile-editable fields from the profile page.
  • Render fullname through escaped Vue slots in active and deleted user listings.
  • Add regression coverage for markup validation, authorization, atomic rejection, credential permissions, and administrative updates.

How to Test

  • Run ./vendor/bin/phpunit tests/unit/ProcessMaker/Rules/PlainTextTest.php tests/Feature/Api/UsersTest.php tests/Feature/ProfileTest.php.
  • Run npm run development.
  • Confirm markup payloads return 422, unauthorized or disallowed self-service updates return 403, and valid updates return 204.
  • Open both Users and Deleted Users and confirm existing malicious names appear as literal text without creating executable DOM nodes or JavaScript dialogs.

Related Tickets & Packages

ci:deploy

@eiresendez eiresendez self-assigned this Aug 27, 2026
@nolanpro

Copy link
Copy Markdown
Contributor

QA server K8S was successfully deployed https://ci-2f0532ef18.engk8s.processmaker.net

@decisions-sonarqube

Copy link
Copy Markdown

@nolanpro

Copy link
Copy Markdown
Contributor

QA server K8S was successfully deployed https://ci-2f0532ef18.engk8s.processmaker.net

@eiresendez

Copy link
Copy Markdown
Contributor Author

Hi @gustavobascope could you please do a code review when you have a chance? Thanks!!

@CarliPinell

Copy link
Copy Markdown
Contributor

The code looks good. No observations.

@CarliPinell
CarliPinell self-requested a review August 31, 2026 14:13

@CarliPinell CarliPinell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No observations were found.

@eiresendez
eiresendez removed the request for review from gustavobascope August 31, 2026 14:15

@gustavobascope gustavobascope left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

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.

4 participants