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

Potential data corruption issue for multipart stream upload for OCI Python SDK #410

Open
bhagwatvyas opened this issue Dec 20, 2021 · 3 comments
Labels
SDK Issue pertains to the SDK itself and not specific to any service

Comments

@bhagwatvyas
Copy link
Member

bhagwatvyas commented Dec 20, 2021

If you are using oci.object_storage.UploadManager.upload_stream, this issue may affect you. This issue is currently under investigation.

Update (1/12): The root cause of the issue causing data corruption has been fixed with the release of OCI Python SDK v2.54.0. Please use oci v2.54.0 or above to avoid data corruption. The behavior of older versions of the OCI Python SDK regarding this issue have been explained below.

Update (12/22): After more investigation and with the release of OCI Python SDK v2.53.1, here's more details about the issue and possible resolutions/workarounds:
Customers using oci.object_storage.UploadManager.upload_stream in FIPS mode may be vulnerable to silent data corruption. The SDK reports success for this operation, but a 0-length object is uploaded. The resolution differs across these scenarios:

  1. Using UploadManager.upload_stream() in an environment which uses a FIPS compliant openssl, but the SDK is not operating in FIPS mode:

    • Customers using FIPS compliant openssl but not operating the SDK in FIPS mode using one of the ways mentioned in the OCI Python SDK's docs fall under this scenario.
    • If oci.fips.is_fips_mode() returns True, then the SDK is in FIPS mode.
    • You can verify if you are using a FIPS compliant openssl by running the command openssl version. If "fips" is part of the version name, and you are not operating the SDK in FIPS mode, then you would fall under this scenario.
      Workaround: Upgrade the OCI Python SDK to v2.53.1 or above, and operate the SDK in FIPS mode as mentioned in the OCI Python SDK's docs. Not operating the SDK in FIPS mode while using a FIPS compliant openssl would still result in data corruption with UploadManager.upload_stream().
  2. Using UploadManager.upload_stream() when the SDK is operating in FIPS mode, using OCI Python SDK v2.53.0 or lower:

    • Customers operating the SDK in FIPS mode, using one of the ways mentioned in the OCI Python SDK's docs fall under this scenario.
    • If oci.fips.is_fips_mode() returns True, then the SDK is in FIPS mode.
      Resolution: Upgrade the OCI Python SDK to v2.53.1 or above.

Update (12/20): The issue seems to affect these specific scenarios:

This was reported for OCI CLI which uses the OCI Python SDK's APIs for object upload. More details on the OCI CLI issue here - oracle/oci-cli#490 (comment)

@bhagwatvyas bhagwatvyas pinned this issue Dec 20, 2021
@bhagwatvyas bhagwatvyas changed the title Potential data corruption issue for multipart stream upload in FIPS environments using Python SDK in OCI Cloud Shell Potential data corruption issue for multipart stream upload for OCI Python SDK Dec 20, 2021
@bhagwatvyas
Copy link
Member Author

Updated the original issue with the specific scenarios being affected. Posting as a comment again so the customers who are watching this issue would be notified by github:

The issue seems to affect these specific scenarios:

We are testing the fixes for this issue.

@jodoglevy jodoglevy added the SDK Issue pertains to the SDK itself and not specific to any service label Dec 21, 2021
@bhagwatvyas
Copy link
Member Author

After more investigation and with the release of OCI Python SDK v2.53.1, here's more details about the issue and possible resolutions/workarounds:
Customers using oci.object_storage.UploadManager.upload_stream in FIPS mode may be vulnerable to silent data corruption. The SDK reports success for this operation, but a 0-length object is uploaded. The resolution differs across these scenarios:

  1. Using UploadManager.upload_stream() in an environment which uses a FIPS compliant openssl, but the SDK is not operating in FIPS mode:

    • Customers using FIPS compliant openssl but not operating the SDK in FIPS mode using one of the ways mentioned in the OCI Python SDK's docs fall under this scenario.
    • If oci.fips.is_fips_mode() returns True, then the SDK is in FIPS mode.
    • You can verify if you are using a FIPS compliant openssl by running the command openssl version. If "fips" is part of the version name, and you are not operating the SDK in FIPS mode, then you would fall under this scenario.

    Workaround: Upgrade the OCI Python SDK to v2.53.1 or above, and operate the SDK in FIPS mode as mentioned in the OCI Python SDK's docs. Not operating the SDK in FIPS mode while using a FIPS compliant openssl would still result in data corruption with UploadManager.upload_stream().

  2. Using UploadManager.upload_stream() when the SDK is operating in FIPS mode, using OCI Python SDK v2.53.0 or lower:

    • Customers operating the SDK in FIPS mode, using one of the ways mentioned in the OCI Python SDK's docs fall under this scenario.
    • If oci.fips.is_fips_mode() returns True, then the SDK is in FIPS mode.

    Resolution: Upgrade the OCI Python SDK to v2.53.1 or above.

@bhagwatvyas
Copy link
Member Author

bhagwatvyas commented Jan 12, 2022

The root cause of the issue causing data corruption has been fixed with the release of v2.54.0. Please use oci v2.54.0 or above to avoid data corruption. The behavior of older versions of the OCI Python SDK regarding this issue have been explained in the older comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SDK Issue pertains to the SDK itself and not specific to any service
Projects
None yet
Development

No branches or pull requests

2 participants