fix(rest): Unauthorrrized access to backend configurations.#3797
Open
rudra-superrr wants to merge 1 commit intoeclipse-sw360:mainfrom
Open
fix(rest): Unauthorrrized access to backend configurations.#3797rudra-superrr wants to merge 1 commit intoeclipse-sw360:mainfrom
rudra-superrr wants to merge 1 commit intoeclipse-sw360:mainfrom
Conversation
8db00cf to
4566d9e
Compare
Member
|
Hey @rudra-superrr , can you please add the following keys to the admin-only list as well?
|
Signed-off-by: rudra-superrr <prabhuchopra@gmail.com>
4566d9e to
650fd5b
Compare
Contributor
Author
|
Hi @GMishx , added the above mentioned fields too. |
GMishx
requested changes
Mar 5, 2026
| TOOL_NAME, TOOL_VENDOR, IS_PACKAGE_PORTLET_ENABLED, PACKAGE_PORTLET_WRITE_ACCESS_USER_ROLE, INHERIT_ATTACHMENT_USAGES, | ||
| RELEASE_FRIENDLY_URL, IS_ADMIN_PRIVATE_ACCESS_ENABLED, SKIP_DOMAINS_FOR_VALID_SOURCE_CODE, VCS_HOSTS, | ||
| NON_PKG_MANAGED_COMPS_PROP, REST_API_TOKEN_LENGTH, | ||
| NON_PKG_MANAGED_COMPS_PROP, REST_API_TOKEN_LENGTH, SVM_NOTIFICATION_URL, |
Member
There was a problem hiding this comment.
Lets not insert the SVM_NOTIFICATION_URL here as this is read from the properties file and this PR should not change the existing functionality.
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.
Description: Any regular user in the SW360 web application is able to read the backend configuration values through
the REST API.
Problem: The GET /api/configurations/container/SW360_CONFIGURATION endpoint exposes all configuration keys—including sensitive admin-only settings like attachment.store.file.system.location, rest.apitoken.generator.length, force.update.enabled, and admin.private.project.access.enabled—to any authenticated user with READ authority, with no role-based filtering.
Solution: Define an ADMIN_ONLY_CONFIG_KEYS set in SW360ConfigKeys, then filter those keys out in SW360ConfigurationsService for non-admin users before returning the configuration map from the controller's GET endpoints.
Testing: Verify that when a regular user (USER role) calls GET /api/configurations/container/SW360_CONFIGURATION, the response does not contain attachment.store.file.system.location, rest.apitoken.generator.length, force.update.enabled, or admin.private.project.access.enabled. When an ADMIN or SW360_ADMIN user calls the same endpoint, all keys including the admin-only ones should be present in the response.