-
Notifications
You must be signed in to change notification settings - Fork 481
fix(security): backport SQL injection + auth fixes to 26.04.28 (hotfix) #35608
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
Closed
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
fe06eed
fix(publisher): parameterize getPublishAuditStatuses bundle-id query
mbiuki f99c305
test(publisher): regression tests for getPublishAuditStatuses paramet…
mbiuki 28421fa
Apply suggestions from code review
mbiuki d65256a
fix: remove duplicate placeholders block from accidental suggestion a…
mbiuki 9528652
fix(rest): require backend user + publishing-queue portlet on AuditPu…
mbiuki 19f9e75
test: use dotCMS-specific SecurityException in AuditPublishingResourc…
mbiuki ab63ecb
add AuditPublishingResourceTest to the MainSuite2a
dario-daza 9bf0b2d
use PP authorization in AuditPublishingResource instead of WebResourc…
dario-daza 25b8bd6
fix(publisher): add PP auth header to audit poll and prevent 500 on m…
dario-daza 569fc6b
🏁 Publishing release version [26.04.28-03]
dotCMS-Machine-User d408d3e
fix(cicd): backport workflow_dispatch trigger to release-26.04.28-03
sfreudenthaler 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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| -Dprod=true | ||
| -Drevision=26.04.28-02 | ||
| -Drevision=26.04.28-03 | ||
| -Dchangelist= |
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
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
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
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
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
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
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
51 changes: 51 additions & 0 deletions
51
dotcms-integration/src/test/java/com/dotcms/rest/AuditPublishingResourceTest.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| package com.dotcms.rest; | ||
|
|
||
| import com.dotcms.IntegrationTestBase; | ||
| import com.dotcms.util.IntegrationTestInitService; | ||
| import org.junit.BeforeClass; | ||
| import org.junit.Test; | ||
|
|
||
| import javax.servlet.http.HttpServletRequest; | ||
| import javax.ws.rs.core.Response; | ||
| import java.util.Collections; | ||
|
|
||
| import static org.junit.Assert.assertEquals; | ||
| import static org.mockito.Mockito.mock; | ||
|
|
||
| /** | ||
| * Verifies that {@link AuditPublishingResource} enforces push-publish token | ||
| * authentication on its endpoints. Both methods were previously reachable | ||
| * anonymously; they now require a valid PP auth token. | ||
| */ | ||
| public class AuditPublishingResourceTest extends IntegrationTestBase { | ||
|
|
||
| @BeforeClass | ||
| public static void prepare() throws Exception { | ||
| IntegrationTestInitService.getInstance().init(); | ||
| } | ||
|
|
||
| /** | ||
| * Method to test: {@link AuditPublishingResource#get(String, HttpServletRequest)} | ||
| * When: called with a request that carries no push-publish auth token | ||
| * Should: return 401 Unauthorized. | ||
| */ | ||
| @Test | ||
| public void test_get_rejectsAnonymousRequest() { | ||
| final HttpServletRequest request = mock(HttpServletRequest.class); | ||
| final Response response = new AuditPublishingResource().get("any-bundle-id", request); | ||
| assertEquals(Response.Status.UNAUTHORIZED.getStatusCode(), response.getStatus()); | ||
| } | ||
|
|
||
| /** | ||
| * Method to test: {@link AuditPublishingResource#getAll(java.util.List, HttpServletRequest)} | ||
| * When: called with a request that carries no push-publish auth token | ||
| * Should: return 401 Unauthorized. | ||
| */ | ||
| @Test | ||
| public void test_getAll_rejectsAnonymousRequest() { | ||
| final HttpServletRequest request = mock(HttpServletRequest.class); | ||
| final Response response = new AuditPublishingResource() | ||
| .getAll(Collections.singletonList("any-bundle-id"), request); | ||
| assertEquals(Response.Status.UNAUTHORIZED.getStatusCode(), response.getStatus()); | ||
| } | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.