Usage of insecure websocket connection
- Rule ID: python_lang_insecure_websocket
- Languages: python
- Source: insecure_websocket.yml
Description
Using insecure websocket connections can compromise data security. This vulnerability arises when applications connect to APIs without SSL, making the data susceptible to interception and manipulation.
Remediations
- Do not use unsecured websocket connections. These connections lack encryption, putting data at risk.
websockets.connect("ws://insecure-api.com") # unsafe
- Do ensure all websocket connections are secured with SSL. This encrypts the data, protecting it from unauthorized access.
websockets.connect("wss://secure-api.com")
References
Associated CWE
OWASP Top 10
Configuration
To skip this rule during a scan, use the following flag
bearer scan /path/to/your-project/ --skip-rule=python_lang_insecure_websocket
To run only this rule during a scan, use the following flag
bearer scan /path/to/your-project/ --only-rule=python_lang_insecure_websocket