Skip to main content

SKY-D356 · Security in code

Cleartext outbound HTTP

Medium

A URL that starts with http:// is sent without encryption. SKY-D356 reports Python requests, httpx and urllib calls whose URL has an explicit http:// scheme and a host other than the local machine. In Rust it reports a dispatched reqwest request that targets a cleartext URL and sets Basic, Bearer or Authorization credentials.

Languages
Python, Rust
Quality gate
counted toward the gate limits (full and diff scans)
Finding type
review
Wrong result? Report itA false positive, a missed case or a confusing message: it goes privately to the founder.

Why it matters

Anyone on the network path, such as a shared Wi-Fi, a compromised router or a cloud neighbour, can read the request and the reply, including tokens, cookies and personal data, and can change the reply, for example to send back wrong prices or a malicious download.

What Skylos flags

app/rates.py · PythonReported on line 5
import requests  def fetch_rates(currency):    response = requests.get(f"http://rates.example.com/v1/{currency}", timeout=10)    response.raise_for_status()    return response.json()

What Skylos leaves alone

app/health.py · Python
import requests  def sidecar_ready():    response = requests.get("http://127.0.0.1:15000/ready", timeout=2)    return response.ok

Why Skylos leaves it alone

The request goes to a loopback address, so it never leaves the machine. Skylos skips localhost and loopback IP addresses when the host part of the URL is complete.

More languages

Rust

Flagged

src/status.rs · RustReported on line 4
use reqwest::blocking::Client;pub fn status(token: &str) {    let client = Client::new();    let _ = client.get("http://api.example.org/status").bearer_auth(token).send();}

Not flagged

src/status.rs · Rust
use reqwest::blocking::Client;pub fn status(token: &str) {    let client = Client::new();    let _ = client.get("https://api.example.org/status").bearer_auth(token).send();}

Why Skylos leaves it alone

The client uses HTTPS for the authenticated request.

How Skylos decides

  1. Rust requires a literal HTTP destination, a recognized reqwest client, an authentication API or Authorization header, and a blocking send or an async request that is polled. A caller-supplied client can still reject the URL at runtime. Local HTTPS-only builders, loopback addresses and unpolled request futures stay quiet.
  2. Finds get, post, put, patch, delete, head, options and request on the requests and httpx modules, and urllib.request.urlopen() and urllib.request.Request(), resolved through imports.
  3. Reads the URL: the first argument (the second for request(method, url)), or url=. It uses the literal value, or the fixed text at the start of an f-string, + expression or local name.
  4. Reports MEDIUM when that text starts with http:// and names a host, or when it is a fixed http:// prefix followed by unknown text.
  5. Skips localhost and loopback addresses such as 127.0.0.1 and [::1], once the host part is complete. The finding records a transport choice; it does not claim that sensitive data is sent.

How to fix it

Use https://. If the other side only speaks HTTP inside a private network, put it behind TLS or keep the traffic on the local machine.

app/rates.py · Python · the fix, against the flagged file
import requests  def fetch_rates(currency):Removed:     response = requests.get(f"http://rates.example.com/v1/{currency}", timeout=10)Added:     response = requests.get(f"https://rates.example.com/v1/{currency}", timeout=10)    response.raise_for_status()    return response.json()

When it can be wrong

  • A call to a service on a private network or a container next to yours, such as http://redis-proxy:8080/, is reported; only loopback hosts are skipped.
  • Public data fetched over HTTP on purpose, such as a test fixture server, is reported the same way.

Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.

How to silence it

  • Mark a reviewed line and say why. Only the listed rule is hidden.

    Python
    requests.get(url)  # skylos: ignore[SKY-D356] mesh sidecar adds mTLS
  • Accept the findings you already have with skylos baseline ., then scan with --baseline so only new ones are listed.

  • [tool.skylos] ignore = ["SKY-D356"] turns the rule off for the whole project.

From the Skylos rule handbook, Skylos 5.8.0 (commit 5b880b0). All rules.