Skip to content
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

[Fix] Fix vulnerabilities in the present SDK version #383

Conversation

samikshya-db
Copy link
Contributor

@samikshya-db samikshya-db commented Nov 6, 2024

What changes are proposed in this pull request?

  • What :

    • Update commons.io to fix the CVE in the present version. Looks like depandabot PRs are no longer being created/merged. [Link]
    • Change ini4j configuration because of vulnerability.
  • Why

    • ini4j 0.5.4 version has an infinite loop situation in the following piece of code. This loop can cause excessive memory and CPU usage, potentially crashing the application. Alternate libraries like Apache Commons Configuration gracefully handle the situation (by limiting the recursions internally). I will raise a PR on SDK later today to replace the ini4j library. Moreover : the official site of ini4j is up for sale and the last update to this maven package was done in 2015. There is no reason we should continue to use this package.
Ini ini = new Ini();
  ini.load(new ByteArrayInputStream("""
      [deploy]
      a = ${test/a}
      b = ${doc/b}
              
      [test]
      a = ${deploy/a}
      b = ${deploy/b}
              
      [doc]
      a = 15
      b = 45
      """.getBytes(StandardCharsets.UTF_8)));
  
  // Will cause stack overflow
  ini.get("deploy").fetch("a");

How is this tested?

  • The existing unit tests run fine.

Copy link

github-actions bot commented Nov 7, 2024

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/sdk-java

Inputs:

  • PR number: 383
  • Commit SHA: 6d23597b91bbaa157507791ae471b15a541d20eb

Checks will be approved automatically on success.

@samikshya-db samikshya-db changed the title Fix vulnerabilities [Fix] Fix vulnerabilities in the present SDK version Nov 7, 2024
@eng-dev-ecosystem-bot
Copy link
Collaborator

Test Details: go/deco-tests/11722901230

Copy link
Contributor

@renaudhartert-db renaudhartert-db left a comment

Choose a reason for hiding this comment

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

LGTM

@renaudhartert-db renaudhartert-db added this pull request to the merge queue Nov 7, 2024
Merged via the queue into databricks:main with commit 849cd3d Nov 7, 2024
17 of 19 checks passed
renaudhartert-db added a commit that referenced this pull request Nov 7, 2024
### New Features and Improvements

 * DatabricksConfig: Add clone() support ([#376](#376)).

### Bug Fixes

 * Fix vulnerabilities in the present SDK version ([#383](#383)).

### Internal Changes

 * Add test instructions for external contributors ([#370](#370)).
 * Always write message for manual test integration ([#374](#374)).
 * Automatically trigger integration tests on PR ([#369](#369)).
 * Move templates in the code generator ([#373](#373)).
 * Refresh PR template ([#381](#381)).

### API Changes:

 * Added `workspaceClient.aibiDashboardEmbeddingAccessPolicy()` service and `workspaceClient.aibiDashboardEmbeddingApprovedDomains()` service.
 * Added `workspaceClient.credentials()` service.
 * Added `appDeployment` field for `com.databricks.sdk.service.apps.CreateAppDeploymentRequest`.
 * Added `app` field for `com.databricks.sdk.service.apps.CreateAppRequest`.
 * Added `app` field for `com.databricks.sdk.service.apps.UpdateAppRequest`.
 * Added `table` field for `com.databricks.sdk.service.catalog.CreateOnlineTableRequest`.
 * Added `azureAad` field for `com.databricks.sdk.service.catalog.GenerateTemporaryTableCredentialResponse`.
 * Added `omitUsername` field for `com.databricks.sdk.service.catalog.ListTablesRequest`.
 * Added `fullName` field for `com.databricks.sdk.service.catalog.StorageCredentialInfo`.
 * Added `dashboard` field for `com.databricks.sdk.service.dashboards.CreateDashboardRequest`.
 * Added `schedule` field for `com.databricks.sdk.service.dashboards.CreateScheduleRequest`.
 * Added `subscription` field for `com.databricks.sdk.service.dashboards.CreateSubscriptionRequest`.
 * Added `warehouseId` field for `com.databricks.sdk.service.dashboards.Schedule`.
 * Added `dashboard` field for `com.databricks.sdk.service.dashboards.UpdateDashboardRequest`.
 * Added `schedule` field for `com.databricks.sdk.service.dashboards.UpdateScheduleRequest`.
 * Added `only` field for `com.databricks.sdk.service.jobs.RunNow`.
 * Added `pageToken` field for `com.databricks.sdk.service.oauth2.ListServicePrincipalSecretsRequest`.
 * Added `nextPageToken` field for `com.databricks.sdk.service.oauth2.ListServicePrincipalSecretsResponse`.
 * Added `restartWindow` field for `com.databricks.sdk.service.pipelines.CreatePipeline`.
 * Added `restartWindow` field for `com.databricks.sdk.service.pipelines.EditPipeline`.
 * Added `connectionName` field for `com.databricks.sdk.service.pipelines.IngestionGatewayPipelineDefinition`.
 * Added `restartWindow` field for `com.databricks.sdk.service.pipelines.PipelineSpec`.
 * Added `isNoPublicIpEnabled` field for `com.databricks.sdk.service.provisioning.CreateWorkspaceRequest`.
 * Added `privateAccessSettingsId` field for `com.databricks.sdk.service.provisioning.UpdateWorkspaceRequest`.
 * Added `externalCustomerInfo` and `isNoPublicIpEnabled` fields for `com.databricks.sdk.service.provisioning.Workspace`.
 * Added `lastUsedDay` field for `com.databricks.sdk.service.settings.TokenInfo`.
 * Changed `create()` method for `workspaceClient.apps()` service with new required argument order.
 * Changed `executeMessageQuery()` method for `workspaceClient.genie()` service . New request type is `com.databricks.sdk.service.dashboards.GenieExecuteMessageQueryRequest` class.
 * Changed `executeMessageQuery()` method for `workspaceClient.genie()` service to type `executeMessageQuery()` method for `workspaceClient.genie()` service.
 * Changed `create()`, `createSchedule()`, `createSubscription()` and `updateSchedule()` methods for `workspaceClient.lakeview()` service with new required argument order.
 * Removed `workspaceClient.cleanRooms()` service.
 * Removed `deploymentId`, `mode` and `sourceCodePath` fields for `com.databricks.sdk.service.apps.CreateAppDeploymentRequest`.
 * Removed `description`, `name` and `resources` fields for `com.databricks.sdk.service.apps.CreateAppRequest`.
 * Removed `description` and `resources` fields for `com.databricks.sdk.service.apps.UpdateAppRequest`.
 * Removed `name` and `spec` fields for `com.databricks.sdk.service.catalog.CreateOnlineTableRequest`.
 * Removed `displayName`, `parentPath`, `serializedDashboard` and `warehouseId` fields for `com.databricks.sdk.service.dashboards.CreateDashboardRequest`.
 * Removed `cronSchedule`, `displayName` and `pauseStatus` fields for `com.databricks.sdk.service.dashboards.CreateScheduleRequest`.
 * Removed `subscriber` field for `com.databricks.sdk.service.dashboards.CreateSubscriptionRequest`.
 * Removed `displayName`, `etag`, `serializedDashboard` and `warehouseId` fields for `com.databricks.sdk.service.dashboards.UpdateDashboardRequest`.
 * Removed `cronSchedule`, `displayName`, `etag` and `pauseStatus` fields for `com.databricks.sdk.service.dashboards.UpdateScheduleRequest`.
 * Removed `prevPageToken` field for `com.databricks.sdk.service.jobs.Run`.

OpenAPI SHA: d25296d2f4aa7bd6195c816fdf82e0f960f775da, Date: 2024-11-07
github-merge-queue bot pushed a commit that referenced this pull request Nov 7, 2024
### New Features and Improvements

* DatabricksConfig: Add clone() support
([#376](#376)).


### Bug Fixes

* Fix vulnerabilities in the present SDK version
([#383](#383)).


### Internal Changes

* Add test instructions for external contributors
([#370](#370)).
* Always write message for manual test integration
([#374](#374)).
* Automatically trigger integration tests on PR
([#369](#369)).
* Move templates in the code generator
([#373](#373)).
* Refresh PR template
([#381](#381)).


### API Changes:

* Added `workspaceClient.aibiDashboardEmbeddingAccessPolicy()` service
and `workspaceClient.aibiDashboardEmbeddingApprovedDomains()` service.
 * Added `workspaceClient.credentials()` service.
* Added `appDeployment` field for
`com.databricks.sdk.service.apps.CreateAppDeploymentRequest`.
* Added `app` field for
`com.databricks.sdk.service.apps.CreateAppRequest`.
* Added `app` field for
`com.databricks.sdk.service.apps.UpdateAppRequest`.
* Added `table` field for
`com.databricks.sdk.service.catalog.CreateOnlineTableRequest`.
* Added `azureAad` field for
`com.databricks.sdk.service.catalog.GenerateTemporaryTableCredentialResponse`.
* Added `omitUsername` field for
`com.databricks.sdk.service.catalog.ListTablesRequest`.
* Added `fullName` field for
`com.databricks.sdk.service.catalog.StorageCredentialInfo`.
* Added `dashboard` field for
`com.databricks.sdk.service.dashboards.CreateDashboardRequest`.
* Added `schedule` field for
`com.databricks.sdk.service.dashboards.CreateScheduleRequest`.
* Added `subscription` field for
`com.databricks.sdk.service.dashboards.CreateSubscriptionRequest`.
* Added `warehouseId` field for
`com.databricks.sdk.service.dashboards.Schedule`.
* Added `dashboard` field for
`com.databricks.sdk.service.dashboards.UpdateDashboardRequest`.
* Added `schedule` field for
`com.databricks.sdk.service.dashboards.UpdateScheduleRequest`.
 * Added `only` field for `com.databricks.sdk.service.jobs.RunNow`.
* Added `pageToken` field for
`com.databricks.sdk.service.oauth2.ListServicePrincipalSecretsRequest`.
* Added `nextPageToken` field for
`com.databricks.sdk.service.oauth2.ListServicePrincipalSecretsResponse`.
* Added `restartWindow` field for
`com.databricks.sdk.service.pipelines.CreatePipeline`.
* Added `restartWindow` field for
`com.databricks.sdk.service.pipelines.EditPipeline`.
* Added `connectionName` field for
`com.databricks.sdk.service.pipelines.IngestionGatewayPipelineDefinition`.
* Added `restartWindow` field for
`com.databricks.sdk.service.pipelines.PipelineSpec`.
* Added `isNoPublicIpEnabled` field for
`com.databricks.sdk.service.provisioning.CreateWorkspaceRequest`.
* Added `privateAccessSettingsId` field for
`com.databricks.sdk.service.provisioning.UpdateWorkspaceRequest`.
* Added `externalCustomerInfo` and `isNoPublicIpEnabled` fields for
`com.databricks.sdk.service.provisioning.Workspace`.
* Added `lastUsedDay` field for
`com.databricks.sdk.service.settings.TokenInfo`.
* Changed `create()` method for `workspaceClient.apps()` service with
new required argument order.
* Changed `executeMessageQuery()` method for `workspaceClient.genie()`
service . New request type is
`com.databricks.sdk.service.dashboards.GenieExecuteMessageQueryRequest`
class.
* Changed `executeMessageQuery()` method for `workspaceClient.genie()`
service to type `executeMessageQuery()` method for
`workspaceClient.genie()` service.
* Changed `create()`, `createSchedule()`, `createSubscription()` and
`updateSchedule()` methods for `workspaceClient.lakeview()` service with
new required argument order.
 * Removed `workspaceClient.cleanRooms()` service.
* Removed `deploymentId`, `mode` and `sourceCodePath` fields for
`com.databricks.sdk.service.apps.CreateAppDeploymentRequest`.
* Removed `description`, `name` and `resources` fields for
`com.databricks.sdk.service.apps.CreateAppRequest`.
* Removed `description` and `resources` fields for
`com.databricks.sdk.service.apps.UpdateAppRequest`.
* Removed `name` and `spec` fields for
`com.databricks.sdk.service.catalog.CreateOnlineTableRequest`.
* Removed `displayName`, `parentPath`, `serializedDashboard` and
`warehouseId` fields for
`com.databricks.sdk.service.dashboards.CreateDashboardRequest`.
* Removed `cronSchedule`, `displayName` and `pauseStatus` fields for
`com.databricks.sdk.service.dashboards.CreateScheduleRequest`.
* Removed `subscriber` field for
`com.databricks.sdk.service.dashboards.CreateSubscriptionRequest`.
* Removed `displayName`, `etag`, `serializedDashboard` and `warehouseId`
fields for
`com.databricks.sdk.service.dashboards.UpdateDashboardRequest`.
* Removed `cronSchedule`, `displayName`, `etag` and `pauseStatus` fields
for `com.databricks.sdk.service.dashboards.UpdateScheduleRequest`.
* Removed `prevPageToken` field for
`com.databricks.sdk.service.jobs.Run`.

OpenAPI SHA: d25296d2f4aa7bd6195c816fdf82e0f960f775da, Date: 2024-11-07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants