Repository navigation
refactor(core): fix minor security findings - #170
Merged
Merged
Conversation
Code coverage overviewLanguages: Java Java / code-coverage/jacoco
View coverage of the 10 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
JSLT timeouts do not stop resource-consuming evaluations, and the container health check can incorrectly report healthy services as unhealthy.
2 open issues
What changed in this PR
This PR hardens IDP-Core’s mapping, pagination, and webhook configuration paths, with supporting tests, documentation, and container maintenance.
Changes:
- Adds JSLT payload, nesting, expression-length, and evaluation-time limits.
- Introduces configurable pagination limits and disables unauthenticated webhook configuration by default.
- Updates API documentation, validation tests, container health checks, and maintenance scripts.
| File | Description |
|---|---|
src/test/resources/application-test.yml |
Allows unauthenticated webhook fixtures in tests. |
src/test/java/com/decathlon/idp_core/infrastructure/adapters/ingestion/security/WebhookJwtDecoderProviderTest.java |
Updates security-property construction. |
src/test/java/com/decathlon/idp_core/infrastructure/adapters/ingestion/security/JwtBearerSecurityValidatorTest.java |
Updates security-property construction. |
src/test/java/com/decathlon/idp_core/infrastructure/adapters/entity_mapping/jslt/JsltMappingEngineAdapterTest.java |
Tests payload-size and nesting limits. |
src/test/java/com/decathlon/idp_core/infrastructure/adapters/entity_mapping/jslt/JsltEngineTest.java |
Tests expression limits and timeout responses. |
src/test/java/com/decathlon/idp_core/infrastructure/adapters/api/controller/InboundWebhookManagementControllerTest.java |
Tests invalid pagination requests. |
src/test/java/com/decathlon/idp_core/infrastructure/adapters/api/controller/EntityTemplateControllerTest.java |
Tests pagination rejection and boundary acceptance. |
src/test/java/com/decathlon/idp_core/infrastructure/adapters/api/controller/EntityDynamicMappingControllerTest.java |
Tests invalid pagination requests. |
src/test/java/com/decathlon/idp_core/infrastructure/adapters/api/controller/EntityControllerTest.java |
Expands pagination validation coverage. |
src/test/java/com/decathlon/idp_core/domain/service/webhook/security/WebhookSecurityValidationServiceTest.java |
Tests the unauthenticated-webhook policy. |
src/test/java/com/decathlon/idp_core/domain/service/entity/EntityServiceTest.java |
Adapts search tests to configurable limits. |
src/test/java/com/decathlon/idp_core/architecture/HexagonalArchitectureTest.java |
Restricts Spring Beans dependencies in the domain. |
src/main/resources/application.yml |
Adds pagination and webhook-security settings. |
src/main/java/com/decathlon/idp_core/infrastructure/adapters/ingestion/security/WebhookSecurityProperties.java |
Binds the allow-none setting. |
src/main/java/com/decathlon/idp_core/infrastructure/adapters/ingestion/security/WebhookSecurityConfiguration.java |
Maps configuration into the domain policy. |
src/main/java/com/decathlon/idp_core/infrastructure/adapters/entity_mapping/jslt/JsltMappingEngineAdapter.java |
Checks payload size and depth before tree parsing. |
src/main/java/com/decathlon/idp_core/infrastructure/adapters/entity_mapping/jslt/JsltEngine.java |
Adds expression validation and timed execution. |
src/main/java/com/decathlon/idp_core/infrastructure/adapters/api/handler/ApiExceptionHandler.java |
Provides specific pagination type-error messages. |
src/main/java/com/decathlon/idp_core/infrastructure/adapters/api/dto/in/EntitySearchRequestDtoIn.java |
Defers page-size defaults to the controller. |
src/main/java/com/decathlon/idp_core/infrastructure/adapters/api/controller/EntityController.java |
Applies configured pagination limits and defaults. |
src/main/java/com/decathlon/idp_core/infrastructure/adapters/api/configuration/WebConfiguration.java |
Registers the validating pagination resolver. |
src/main/java/com/decathlon/idp_core/infrastructure/adapters/api/configuration/ValidatingPageableArgumentResolver.java |
Rejects malformed and out-of-range pagination. |
src/main/java/com/decathlon/idp_core/infrastructure/adapters/api/configuration/SwaggerDescription.java |
Documents page-size bounds. |
src/main/java/com/decathlon/idp_core/infrastructure/adapters/api/configuration/SearchProperties.java |
Binds and validates the maximum page size. |
src/main/java/com/decathlon/idp_core/infrastructure/adapters/api/auth/JitProvisioningFilter.java |
Switches to JSpecify’s nullability annotation. |
src/main/java/com/decathlon/idp_core/domain/service/webhook/security/WebhookSecurityValidationService.java |
Rejects disallowed NONE security configurations. |
src/main/java/com/decathlon/idp_core/domain/service/entity/EntityService.java |
Uses shared, configurable pagination validation. |
src/main/java/com/decathlon/idp_core/domain/service/entity/EntityAuditService.java |
Removes an unused service dependency. |
src/main/java/com/decathlon/idp_core/domain/service/entity_graph/EntityGraphService.java |
Validates pagination before fetching graph pages. |
src/main/java/com/decathlon/idp_core/domain/model/search/PaginationCriteria.java |
Centralizes pagination bounds checks. |
src/main/java/com/decathlon/idp_core/domain/model/inbound_connectors/webhook/WebhookSecurityValidationPolicy.java |
Defines the unauthenticated-webhook policy. |
src/main/java/com/decathlon/idp_core/domain/constant/ValidationMessages.java |
Centralizes pagination error messages. |
src/main/java/com/decathlon/idp_core/domain/constant/SearchConstraints.java |
Defines default pagination values. |
src/main/java/com/decathlon/idp_core/domain/constant/JsltConstraints.java |
Defines JSLT processing limits. |
flyway-migration-order-report.md |
Generated migration-report cleanup. |
docs/src/static/swagger.yaml |
Updates published pagination descriptions. |
docs/src/getting-started/configuration.md |
Documents pagination configuration and clarifies CORS examples. |
docs/src/features/webhooks.md |
Explains the default NONE restriction and existing connectors. |
docs/src/features/entity-dynamic-mapping.md |
Documents JSLT limits and error responses. |
docs/src/concepts/entity-filtering.md |
Documents configurable search page limits. |
docs/src/concepts/entities.md |
Documents listing page-size validation. |
Dockerfile |
Simplifies non-root setup and adds a health check. |
.gitignore |
Ignores generated migration reports. |
.github/scripts/summarize_owasp.sh |
Uses Bash conditional syntax. |
.github/scripts/extract_specs.sh |
Uses Bash conditional syntax. |
.github/scripts/check_navigation.sh |
Uses Bash conditional syntax. |
.github/scripts/check_flyway_migration_order.sh |
Uses Bash conditional syntax. |
Review effort: Balanced
brandPittCode
approved these changes
Oct 22, 2026
brandPittCode
previously approved these changes
Oct 22, 2026
brandPittCode
approved these changes
Oct 23, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Eve Bernhard <115796475+evebrnd@users.noreply.github.com>
evebrnd
force-pushed
the
refactor/security-and-tech-improvements
branch
from
October 23, 2026 09:53
51280a8 to
7050d12
Compare
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.





PR Description
What this PR Provides
Add constraints to JSLT processing:
GET /api/v1/entities/{templateIdentifier}accepts page sizes up to and including 500. Requests with a size greater than 500 are rejected with HTTP 400 Bad Request.By default, webhook configurations cannot have security : NONE. This can be altered with application config
idp.security.webhook.allow-none.Enforce a global max pagination size (500 by default). This can be modified using config
app.max-page-sizeReview
The reviewer must double-check these points:
How to test
Scenarios
GET /api/v1/entities/{templateIdentifier}?size=100and then withsize=500. Both requests should return HTTP 200 OK with the requested page size. Repeat withsize=501; the request should return HTTP 400 Bad Request.POST /api/v1/entity_dynamic_mappings/dry-runwith a payload no larger than 1 MiB, nesting depth no greater than 64, and a valid expression no longer than 10,000 characters. The transformation should complete with HTTP 200 OK. Payloads above 1 MiB or nesting deeper than 64 should be rejected with HTTP 400 Bad Request.Breaking changes
sizegreater than 500 are now rejected with HTTP 400 Bad Request.Context of the Breaking Change
The entity listing endpoint now enforces the same maximum page size of 500 as the search endpoint.
Result of the Breaking Change
Clients must request pages of at most 500 entities. Requests at the 500-item boundary remain valid; larger page sizes must be split across multiple requests.'