Skip to content

Conversation

@Pratham-Mishra04
Copy link
Collaborator

No description provided.

Copy link
Collaborator Author

Pratham-Mishra04 commented Apr 10, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@akshaydeo akshaydeo deleted the 04-10-feat_retry_config_added branch April 15, 2025 05:36
kierr pushed a commit to kierr/bifrost that referenced this pull request Nov 20, 2025
…eaming responses

Add comprehensive security hardening to OpenAI provider streaming functions by implementing sanitized logging and size-based DoS protection. These changes prevent sensitive information leakage and protect against memory exhaustion attacks.

Key security improvements:
- Add sanitizeLogData() function that redacts sensitive patterns (tokens, API keys, auth data)
- Implement MaxLogPreviewLength (100 chars) to prevent data exposure in logs
- Add MaxChunkSize validation (1MB) to prevent DoS attacks through oversized chunks
- Replace all raw data logging with sanitized content type, size, and preview
- Applied consistently across text completion, chat completion, responses, speech, and transcription streaming

The sanitized logging approach provides debugging context while ensuring sensitive authentication tokens, API keys, and other credentials are never written to logs. Size validation prevents resource exhaustion attacks that could overwhelm the server with maliciously large streaming chunks.

Addresses security compliance requirements for credential handling and DoS protection.

Relates to milestone maximhq#15: Security and Compliance Hardening
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.

2 participants