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

Setting local Name and Port for /managment/* URI #25106

Conversation

luiseufrasio
Copy link
Contributor

@luiseufrasio luiseufrasio commented Aug 19, 2024

Description

It is possible to trick the Glassfish’s management REST interface by “injecting” a malicious URL via the Host header of a sample request to let the HTML page that is generated by the REST interface when the /management/domain endpoint is targeted.

Important Info

Blockers

None

Testing

New tests

None

Testing Performed

Steps:

  1. run Glassfish
  2. on Powershell run:

Invoke-RestMethod -Method Get -Uri http://local:4848/management/domain
-Headers @{
'Accept' = 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,/;q=0.8'
'Accept-Encoding' = 'gzip, deflate, br'
'Accept-Language' = 'en-US,en;q=0.5'
'Host' = 'google.com'
} > result.html

  1. Open file result.html
  2. Check that google.com is not in the URLs

Testing Environment

Zulu JDK 17 Windows 11 with Maven 3.9.0

Documentation

None

Notes for Reviewers

Copy link
Contributor

@dmatej dmatej left a comment

Choose a reason for hiding this comment

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

Thanks, just tiny issue with checkstyle rules:
15:25:37 [ERROR] src/main/java/org/glassfish/admin/rest/adapter/RestManagementAdapter.java:[22,1] (imports) ImportOrder: Wrong order for 'org.glassfish.admin.restconnector.Constants' import.

Just move those two new imports below Constants (alphabet)

@dmatej dmatej added this to the 7.0.17 milestone Aug 19, 2024
@dmatej dmatej added bug Something isn't working security fix The change (component upgrade or gf code) concerns a CVE labels Aug 19, 2024
@dmatej dmatej force-pushed the luiseufrasio-CVE-2024-7312-link-redirection-via-host-parameter branch from 0892c03 to 3111942 Compare August 27, 2024 08:41
@dmatej dmatej requested review from arjantijms, pzygielo, hs536, avpinchuk and a team August 27, 2024 08:45
@dmatej dmatej merged commit 6ca35ee into eclipse-ee4j:master Aug 27, 2024
2 checks passed
@dmatej dmatej changed the title setting local Name and Port for /managment/* URI Setting local Name and Port for /managment/* URI Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working security fix The change (component upgrade or gf code) concerns a CVE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants