- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- Administrator's Guide
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
ID: python-security/requests-http
Language: Python
Severity: Warning
Category: Security
CWE: 319
Making a request with http enables attackers to listen to the traffic and obtain sensitive information. Use https://
instead.
def test1():
url1 = "http://api.tld"
requests.get(url1)
def test2():
url2 = "http://api.tld/user/{0}".format(user_id)
requests.get(url2)
def test3():
url3 = f"http://api.tld/user/{user_id}"
requests.get(url3)
requests.get(url4)
def test1():
requests.get("http://api.tld")
requests.get("http://api.tld/user/{0}".format(user_id))
requests.get(f"http://api.tld/user/{user_id}")
def download_stuff(identifier, data):
directory = "/tmp"
attachments = data.get("attachments", [])
attachment_url = attachments[0].get("attachment_url", "")
try:
response = requests.get(attachment_url, timeout=300)
response.raise_for_status()
except requests.exceptions.RequestException:
return (False, "")
def test1():
requests.get("https://api.tld")
requests.get("https://api.tld/user/{0}".format(user_id))
requests.get(f"https://api.tld/user/{user_id}")
requests.get(f"http://localhost.tld/user/{user_id}") # localhost and 127.0.0.1 are safe
|
|
For more information, please read the Code Analysis documentation
Identify code vulnerabilities directly in yourVS Code editor
Identify code vulnerabilities directly inJetBrains products