Skip to content

fix(rest): Unauthorrrized access to backend configurations.#3797

Open
rudra-superrr wants to merge 1 commit intoeclipse-sw360:mainfrom
siemens:fix/configEndpoint
Open

fix(rest): Unauthorrrized access to backend configurations.#3797
rudra-superrr wants to merge 1 commit intoeclipse-sw360:mainfrom
siemens:fix/configEndpoint

Conversation

@rudra-superrr
Copy link
Contributor

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.

@rudra-superrr rudra-superrr added needs code review needs general test This is general testing, meaning that there is no org specific issue to check for labels Mar 5, 2026
@GMishx
Copy link
Member

GMishx commented Mar 5, 2026

Hey @rudra-superrr , can you please add the following keys to the admin-only list as well?

  • release.friendly.url: User don't need to know
  • enable.attachment.store.to.file.system: Can be exploited
  • rest.apitoken.length: Can be exploited
  • inherit.attachment.usages: Can be exploited
  • release.sourcecodeurl.skip.domains: Can be exploited
  • attachment.store.file.system.location: Can be exploited
  • rest.force.update.enabled: User don't need to know
  • auto.set.ecc.status: User don't need to know
  • admin.private.project.access.enabled: Can be exploited
  • disable.clearing.fossology.report.download: User don't need to know
  • combined.cli.parser.external.id.correlation.key: Can be exploited
  • svm.notification.url: Can be exploited
  • vcs.hosts: Can be exploited

Signed-off-by: rudra-superrr <prabhuchopra@gmail.com>
@rudra-superrr
Copy link
Contributor Author

Hi @GMishx , added the above mentioned fields too.

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,
Copy link
Member

Choose a reason for hiding this comment

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

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.

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

Labels

needs code review needs general test This is general testing, meaning that there is no org specific issue to check for

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants