T09 · Insecure Skill Coding Practices
Error
- Location
- tts_podcast.py:528
- Finding
- COS Uploads Are Explicitly Made Publicly Readable<![CDATA[ ## Vulnerability Details **File Location**: `tts_podcast.py:528-539` **Vulnerability Type**: Public exposure of generated audio through an insecure object ACL **Risk Level**: High ### Vulnerable Code ```python cli.put_object_from_local_file( Bucket=bucket_full, LocalFilePath=local_path, Key=object_key, ContentType=content_type ) try: cli.put_object_acl(Bucket=bucket_full, Key=object_key, ACL="public-read") except: pass ``` ### Technical Analysis When the optional `upload_cos` feature is enabled, the generated audio file is uploaded to Tencent Cloud Object Storage and the code then explicitly assigns the object a `public-read` ACL. Anonymous users can consequently retrieve the object without Tencent Cloud authentication if they obtain or discover its URL. The generated audio is derived directly from user-provided text. That text may contain personal information, confidential business material, internal documents, credentials spoken as text, or other sensitive content. Public access is not required for the declared text-to-speech capability. If external sharing is needed, a private object with a short-lived signed URL would provide the functionality with substantially less exposure. The broad `except` block suppresses ACL errors. This makes the final access state difficult to determine and prevents callers from receiving reliable information about whether the object is public or private. ### Attack Path 1. A user or calling agent supplies sensitive text for speech generation. 2. The caller enables `upload_cos`. 3. The Skill sends the text to Tencent TTS and creates a local WAV file. 4. `_upload_to_cos()` uploads that WAV file to the configured COS bucket. 5. The Skill assigns `ACL="public-read"` to the uploaded object. 6. An unauthenticated party obtains or discovers the predictable COS host and returned object URL. 7. The party downloads the generated audio without possessing Tencent credentials. ### Impact Assessment T ...[truncated 540 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the explicit public ACL assignment: ```python cli.put_object_acl( Bucket=bucket_full, Key=object_key, ACL="public-read", ) ``` 2. Store generated audio as private objects by default and rely on the bucket's secure default access policy. 3. If temporary external access is required, generate a short-lived pre-signed URL with the minimum necessary lifetime. 4. Require a separate, explicit option and a clear warning before making any object public. 5. Replace the broad `except` block with specific exception handling. Return an error if the requested access policy cannot be applied or verified. 6. Consider encryption, retention limits, and automatic object deletion for generated audio containing potentially sensitive information. 7. Document that both source text and uploaded audio leave the local environment when cloud features are used. ]]>
