Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FISH-10521 Escape HTTP Characters in REST Interface #7216

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Pandrex247
Copy link
Member

@Pandrex247 Pandrex247 commented Feb 25, 2025

Description

Escapes HTTP characters in the REST interface, to help lock down any XSS attempts someone may try if they have access to the application server's filesystem.

Most config which would be displayed here is protected by validation of the domain.xml, as that prevents you from having the "<" or ">" characters as values. The key files however don't have this validation, and so we must escape them.

Important Info

Blockers

None

Testing

New tests

None

Testing Performed

On a clean domain:

Testing Environment

Windows 11, Maven 3.9.9, Zulu JDK 11.0.26

Documentation

payara/Payara-Documentation#552

Notes for Reviewers

None

Fix for CVE-2025-1534.

Uses the existing method to hopefully escape only the config values being displayed,
and not any of the valid HTTP tags.

Signed-off-by: Andrew Pielage <[email protected]>
@Pandrex247 Pandrex247 force-pushed the FISH-10521-Escape-http-characters branch from 3818bb6 to 6e752a9 Compare February 25, 2025 14:34
@Pandrex247 Pandrex247 marked this pull request as ready for review February 25, 2025 15:10
@breakponchito
Copy link
Contributor

@Pandrex247 same is happening with Payara 6, I tried to test and it seems something is missing because after editing the admin-keyfile and including an script I'm still seeing the message when loading the server:

Content of file:
admin<img src=x onerror=alert('XSS')>;{SSHA256}Q3p+X8y0tC4olXfIFMAmKXq+19eFXaDm+C8tBucgdZGfIIM3gl5mNA==;asadmin

image

on the other cases it seems that is working as expected, just the case with the file admin-keyfile

I tested on windows 11, zulu jdk 11 and maven 3.9.5

@Pandrex247
Copy link
Member Author

I just tried again, it worked for me.
Are you sure you built my branch and were testing against that build?
I recommend using private browsing to ensure nothing is cached

Your URL doesn't look correct either? http://localhost:4848/common/index.jsf is the admin console, not the REST management interface

If you've found another vulnerability in the admin console that would be a separate issue/CVE

@Pandrex247
Copy link
Member Author

Pandrex247 commented Mar 4, 2025

after editing the admin-keyfile and including an script

What script are you referring to? There's no reference to editing a script in the reproducer

@luiseufrasio luiseufrasio self-requested a review March 4, 2025 14:13
Copy link
Contributor

@luiseufrasio luiseufrasio left a comment

Choose a reason for hiding this comment

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

LGTM!

Adds additional sanitisation to the user name displayed in the masthead banner, and
on the Domain > Administrator Password page

Signed-off-by: Andrew Pielage <[email protected]>
@breakponchito
Copy link
Contributor

breakponchito commented Mar 4, 2025

@Pandrex247 with latest's changes now I can't see the dialog after injecting javascript code from the key files

@breakponchito breakponchito self-requested a review March 4, 2025 22:01
Copy link
Contributor

@breakponchito breakponchito left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants