Summary
A critical access-control vulnerability in OSSRS SRS can allow a remote attacker to bypass RTMP publish authorization and execute arbitrary code under affected security configurations. The risk arises when RTMP listeners process publish requests through vulnerable vhost-level security checks.
Affected context
The issue affects SRS deployments using RTMP listeners and vhost-level security controls governed by the security.enabled setting. It becomes risky when publish authorization is relied upon to restrict who may publish and the security-checking path does not consistently enforce that boundary.
Exploit preconditions
- Attack surface: Network-accessible SRS RTMP listener
- Required access: Ability to connect to the RTMP service and submit a publish request
- Trigger point: RTMP publish authorization and the associated vhost security check
- Why exploitation is possible: An authorization-control weakness may allow an untrusted publisher to reach functionality intended only for authorized clients, potentially enabling command execution
Why this happens
The vulnerability is rooted in improper access control in the RTMP publish authorization flow. Security decisions involving vhost configuration and SrsSecurity::check() may fail to reliably enforce the intended authorization boundary before sensitive publish-related processing occurs. This maps to CWE-284, where access restrictions are missing, inconsistent, or ineffective.
Potential impact
- An unauthenticated remote attacker may execute arbitrary code
- The SRS process or hosting system could be compromised
- Streaming services and published media could be disrupted or manipulated
- Credentials, tokens, or other accessible sensitive data may be exposed
- A compromised service could be used for further network intrusion
General mitigation guidance
Mitigation generally focuses on making authorization checks complete,
consistent, and fail-closed across every RTMP publish path.
Common defensive patterns include:
- Enforcing authentication and authorization before accepting publish operations
- Treating security.enabled and related vhost settings as security-sensitive policy
- Denying publication by default when authorization state is missing or ambiguous
- Restricting RTMP listener exposure through network segmentation and access controls
- Running the service with the least privileges necessary for its role
- Separating streaming processes from sensitive hosts and administrative networks
- Limiting the process's filesystem, operating-system, and network permissions
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis of authorization branches around RTMP publish handlers and security checks
- Code review for configuration-controlled bypasses, fail-open behavior, and checks performed after sensitive processing
- Tests covering unauthorized, malformed, and boundary-condition publish requests across vhost configurations
- Runtime monitoring for unexpected publish activity, authorization failures, and child-process creation by the streaming service
- Network policy enforcement that limits which clients can reach RTMP listener ports
- Automated security review tools that flag inconsistent access-control enforcement

