-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
OF-248: Add enabled controls for admin ports #3468
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
Open
dwd
wants to merge
2
commits into
igniterealtime:main
Choose a base branch
from
dwd:OF-248
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+47
−6
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift
🔎 Supported by static analysis
🏁 Script executed:
Repository: igniterealtime/Openfire
Length of output: 39879
🏁 Script executed:
# no-opRepository: igniterealtime/Openfire
Length of output: 161
🏁 Script executed:
Repository: igniterealtime/Openfire
Length of output: 33502
🏁 Script executed:
Repository: igniterealtime/Openfire
Length of output: 26277
🏁 Script executed:
Repository: igniterealtime/Openfire
Length of output: 40932
🌐 Web query:
Jetty 12.0.38 ForwardedRequestCustomizer X-Forwarded-Proto Request.isSecure source💡 Result:
In Jetty 12, the ForwardedRequestCustomizer is designed to interpret proxy-forwarding headers (such as
Forwardedper RFC 7239 or the obsoleteX-Forwarded-*headers) and transparently update request metadata, including the value returned byRequest.isSecure()[1][2][3]. When a proxy sendsX-Forwarded-Proto: https, the ForwardedRequestCustomizer updates the request to indicate that the original connection was secure [1][3]. Applications typically access this throughHttpServletRequest.isSecure()orRequest.isSecure()[4][3]. However, users have reported issues in Jetty 12 whereisSecure()may not return the expected value depending on the specific API layers being used [4]. Specifically, in some EE (Jakarta Servlet) environments, theForwardedRequestCustomizerwraps the request to provide an overriddenisSecure()method, but downstream implementations (likeServletApiRequest.isSecure()) may callgetConnectionMetaData().isSecure()instead of the wrappedisSecure()method, leading to a discrepancy whereisSecure()returnsfalsedespite the header being present [4]. Key points regarding the behavior: - Purpose: The customizer ensures that web applications can access the original client's connection information (like protocol and remote address) rather than the proxy's [3]. - Configuration: It supportsX-Forwarded-Protoby default, but it is recommended to use the standard RFC 7239Forwardedheader for more consistent and predictable behavior [1][5][6]. - Potential Issues: IfisSecure()is not reflecting theX-Forwarded-Protoheader, ensure thehttp-forwardedmodule is correctly configured and be aware of potential integration gaps between the Jetty coreRequestwrapper and specific Servlet API implementations [4][6]. For debugging or verifying current behavior in your environment, checking the official Jetty 12 test cases forForwardedRequestCustomizeris recommended, as they cover numerous scenarios regarding header parsing and security state [7][5].Citations:
🌐 Web query:
site:github.com/jetty/jetty.project tag jetty-12.0.38 ForwardedRequestCustomizer.java ServletApiRequest isSecure💡 Result:
In Jetty 12, the
ForwardedRequestCustomizeris designed to process forwarded headers (likeForwardedorX-Forwarded-Proto) to inform the server about the original client's request state [1]. WhenForwardedRequestCustomizerdetermines a request should be considered secure (e.g., due to anX-Forwarded-Proto: httpsheader), it wraps the originalRequestobject to overrideisSecure()to returntrue[2][1]. However, a known issue identified in Jetty 12 (specifically affecting the EE10/Servlet API integration) is thatServletApiRequest.isSecure()does not always reflect this wrapped secure state [2]. TheServletApiRequest.isSecure()implementation typically delegates to the underlying connection's metadata:java `@Override` public boolean isSecure() { return getRequest().getConnectionMetaData().isSecure(); }BecauseServletApiRequestrelies ongetConnectionMetaData().isSecure()rather than the wrappedRequest.isSecure(), it may returnfalseeven if theForwardedRequestCustomizerhas marked the request as secure [2]. This discrepancy has been the subject of issue reports in the Jetty project, where it was noted that while the customizer correctly sets the flag on theRequestwrapper, theServletApiRequestclass bypasses this by checking the connection's metadata directly [2]. To improve the handling of such scenarios, Jetty 12 updates have introduced refactored mechanisms involvingEndPoint.SecurableandSslSessionData, which allow the server to more consistently propagate security metadata across proxied and forwarded requests [3]. If you are encountering issues whereisSecure()returns incorrect values, ensure you are using a recent version of Jetty 12, as ongoing improvements in this area have addressed howForwardedRequestCustomizerandSecureRequestCustomizerinteract with connection security state [3].Citations:
🌐 Web query:
Jetty 12.0.38 source ForwardedRequestCustomizer customize Request isSecure HttpServletRequest💡 Result:
In Jetty 12.0.38, the ForwardedRequestCustomizer is used to interpret proxy-forwarding headers (such as RFC 7239 Forwarded or the obsolete X-Forwarded-* headers) and update the request metadata accordingly [1][2][3]. When the ForwardedRequestCustomizer processes a request, it wraps the original Request object [1][3]. This wrapper ensures that applications calling HttpServletRequest.isSecure receive the correct information based on the forwarded headers (e.g., proto=https in a Forwarded header or X-Forwarded-Proto: https) [1][2][3]. Key points regarding its behavior in Jetty 12: 1. Mechanism: The customizer reads headers to determine if the original communication channel was secure [2][3]. If the request is identified as secure (e.g., through X-Forwarded-Proto: https), the customizer-provided wrapper overrides the isSecure method to return true [1][4]. 2. Evolution and Fixes: Jetty 12 underwent significant refactoring regarding how security metadata is handled, specifically to align with Jakarta Servlet TCK requirements [5]. In earlier 12.0.x versions, there were known issues where isSecure might not have returned the expected value due to how the wrapper interacted with ConnectionMetaData [4]. These issues were addressed in later updates by ensuring that SecureRequestCustomizer and ForwardedRequestCustomizer correctly manage the connection security metadata [5]. 3. Best Practice: The Jetty project strongly recommends using the RFC 7239 Forwarded header rather than X-Forwarded-* headers, as the latter are non-standard and often have conflicting, implementation-specific behaviors [6][7][8]. If your application is still experiencing unexpected isSecure behavior in version 12.0.38, ensure the customizer is correctly added to your HttpConfiguration and that your proxy is configured to send headers that Jetty expects (like the RFC 7239 Forwarded header) [1][2][8].
Citations:
🏁 Script executed:
Repository: igniterealtime/Openfire
Length of output: 14421
🏁 Script executed:
Repository: igniterealtime/Openfire
Length of output: 5535
🏁 Script executed:
Repository: igniterealtime/Openfire
Length of output: 50379
🏁 Script executed:
Repository: igniterealtime/Openfire
Length of output: 5103
🏁 Script executed:
Repository: igniterealtime/Openfire
Length of output: 7201
🏁 Script executed:
Repository: igniterealtime/Openfire
Length of output: 758
🏁 Script executed:
Repository: igniterealtime/Openfire
Length of output: 328
🏁 Script executed:
Repository: igniterealtime/Openfire
Length of output: 3685
🏁 Script executed:
Repository: igniterealtime/Openfire
Length of output: 50379
Preserve the connector that served the request.
When
ADMIN_CONSOLE_FORWARDEDis enabled, Jetty 12.0.38 can propagate a forwardedhttpsscheme toHttpServletRequest.isSecure()on the plain connector. A TLS-terminating proxy can therefore setconnectedUsingSecureAdminPorttotruefor a request served byadminConsole.port. The save branch then forcesembeddedSecurePortEnabled, persistsadminConsole.port = -1when the plain port is unchecked, and disables the connector after restart. Determine the active listener from the local connector, not the forwarded scheme, or add a regression test for this path.🤖 Prompt for AI Agents
Source: MCP tools