Skip to content

Conversation

YongGoose
Copy link
Contributor

fixes #30938

Copy link
Contributor

@rstoyanchev rstoyanchev left a comment

Choose a reason for hiding this comment

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

Couldn't this be checked in RequestMappingHandlerMapping when request mappings are being initialized?

It would avoid repeating that on every call.

@rstoyanchev rstoyanchev added the in: web Issues in web modules (web, webmvc, webflux, websocket) label Oct 1, 2025
Copy link
Member

@sbrannen sbrannen left a comment

Choose a reason for hiding this comment

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

I requested a few changes.

Please also take Rossen's comment into account.

@sbrannen sbrannen added the status: waiting-for-feedback We need additional information before we can continue label Oct 3, 2025
@YongGoose
Copy link
Contributor Author

I'm currently traveling, so I should be able to work on it around Wednesday or Thursday this week.
@rstoyanchev @sbrannen Thank you both so much for the great reviews! 🙇🏻‍♂️

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Oct 6, 2025
Signed-off-by: yongjunhong <[email protected]>
Signed-off-by: yongjunhong <[email protected]>
Signed-off-by: yongjunhong <[email protected]>
@YongGoose
Copy link
Contributor Author

Couldn't this be checked in RequestMappingHandlerMapping when request mappings are being initialized?

It would avoid repeating that on every call.

Please take a look :)

@YongGoose
Copy link
Contributor Author

@sbrannen @rstoyanchev

If you have some time, I’d really appreciate it if you could take a look at this PR as well. 🙇🏻‍♂️🙇🏻‍♂️

It’s similar to the this PR, focusing on the access modifiers and proxies!!

Copy link
Member

@sbrannen sbrannen left a comment

Choose a reason for hiding this comment

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

Thanks for making the requested changes. It's looking better. 👍

I've requested a few additional changes in this follow up review.

Also, please make analogous changes to org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMapping and org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMappingTests.

@sbrannen sbrannen self-assigned this Oct 10, 2025
@sbrannen sbrannen added type: enhancement A general enhancement status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Oct 10, 2025
YongGoose and others added 8 commits October 11, 2025 09:55
…c/method/annotation/RequestMappingHandlerMapping.java

Co-authored-by: Sam Brannen <[email protected]>
Signed-off-by: Yongjun Hong <[email protected]>
…c/method/annotation/RequestMappingHandlerMappingTests.java

Co-authored-by: Sam Brannen <[email protected]>
Signed-off-by: Yongjun Hong <[email protected]>
…c/method/annotation/RequestMappingHandlerMappingTests.java

Co-authored-by: Sam Brannen <[email protected]>
Signed-off-by: Yongjun Hong <[email protected]>
…c/method/annotation/RequestMappingHandlerMappingTests.java

Co-authored-by: Sam Brannen <[email protected]>
Signed-off-by: Yongjun Hong <[email protected]>
…c/method/annotation/RequestMappingHandlerMappingTests.java

Co-authored-by: Sam Brannen <[email protected]>
Signed-off-by: Yongjun Hong <[email protected]>
…c/method/annotation/RequestMappingHandlerMappingTests.java

Co-authored-by: Sam Brannen <[email protected]>
Signed-off-by: Yongjun Hong <[email protected]>
Signed-off-by: yongjunhong <[email protected]>
Signed-off-by: yongjunhong <[email protected]>
@YongGoose YongGoose requested a review from sbrannen October 11, 2025 12:52
Signed-off-by: yongjunhong <[email protected]>
@sbrannen sbrannen removed status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged or decided on labels Oct 11, 2025
@sbrannen sbrannen added this to the 7.0.0-RC1 milestone Oct 11, 2025
@sbrannen sbrannen changed the title Prevent reflective invocation of private methods in web dispatcher Reject invocation of private handler methods on CGLIB proxied controller Oct 11, 2025
Copy link
Member

@sbrannen sbrannen left a comment

Choose a reason for hiding this comment

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

Thanks for making all of the requested changes. 👍

I think this PR looks pretty good now, and I'll review it once more in detail before merging it into main.

@sbrannen sbrannen dismissed rstoyanchev’s stale review October 11, 2025 15:21

The requested change has already been made.

@sbrannen sbrannen changed the title Reject invocation of private handler methods on CGLIB proxied controller Reject invocation of effectively private handler methods on CGLIB proxied controller Oct 11, 2025
@sbrannen sbrannen changed the title Reject invocation of effectively private handler methods on CGLIB proxied controller Reject effectively private handler methods on CGLIB proxied controllers Oct 11, 2025
@sbrannen sbrannen closed this in 8edc7cd Oct 11, 2025
sbrannen added a commit that referenced this pull request Oct 11, 2025
@sbrannen
Copy link
Member

This has been merged into main in 8edc7cd and revised in 0389684.

Thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invoking private method on a CGLIB proxy should trigger a dedicated exception

4 participants