Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

internetdata-django

Latest version: v1.1.1

Overview

Last scanned
26 Nov 2026
Published
26 Nov 2026
PyPI package Publisher: mslm
0 Stars
0 Forks
11 Versions
1.1K Downloads
Python Repo language

Scan summary

internetdata-django was last scanned on 26 Nov 2026 at version 1.1.1. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 11 versions; the latest 5 were published within 5 days (22–26 Nov 2026).
  • Findings: No rules fired in version 1.1.1.
  • Downloads: 1,056 downloads.

Versions

11 versions published
Versions and the rules that fired in each
VersionPublishedStatus
1.1.1 LATEST 26 Nov 2026 No rules fired
1.1.0 25 Nov 2026 No rules fired
1.0.8 24 Nov 2026 No rules fired
1.0.7 23 Nov 2026 Not shown
1.0.6 22 Nov 2026 Not shown

No rules fired in 1.1.1

Findings

Findings for v1.1.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 1.1.1; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

InternetData Django Middleware

PyPI license

The official Django middleware for the InternetData API.

It looks up the visitor behind each request, where they are, which network they come from and whether it's a VPN, a proxy, Tor or a hosting server, and hands the answer to your views. Blocking is opt-in.

Getting Started

pip install internetdata-django

Requires Python 3.11 or newer and Django 4.2 or newer.

Without an API key a lookup is on Unlimited, the free plan: the country, the network and the company behind the address, and the Tor, relay and anycast flags, with no daily or monthly cap. Every lookup your app makes comes from your server's one address, though, so a busy site will see bursts refused. A paid plan answers every field, VPN, the proxy flags, hosting, CDN, bot, carrier, satellite, the service flags and the city among them; create a key in the console. A free account tries every field.

Add it to MIDDLEWARE and configure it with an INTERNETDATA dict:

# settings.py
MIDDLEWARE = [
    # ...
    "internetdata_django.InternetDataMiddleware",
]

INTERNETDATA = {"api_key": os.environ.get("INTERNETDATA_API_KEY")}
def index(request):
    result = request.internetdata.result
    country = result.location.country_name if result else "somewhere"
    return HttpResponse(f"Hello, visitor from {country}")

By default nothing is blocked. Every request gets a request.internetdata and your own code decides what it means: a currency to show, a sign-up to review, a page to keep from some countries.

A request your skip claims gets no answer, so it carries no request.internetdata. Wherever skip can apply, read the answer as lookup(request), imported from internetdata_django, which is None for such a request.

Blocking

Pass a block_condition and a matching request is answered with 403 and never reaches your views.

INTERNETDATA = {
    "api_key": os.environ.get("INTERNETDATA_API_KEY"),
    "block_condition": {"location": {"country": ["CU", "IR", "KP"]}},
}

A condition is written in the shape of a result, keyed by the same names the API uses, and only the members you name are considered, so it can refuse on anything in the answer. The country works on every plan, and so do the first two of these:

{"asn": {"type": "hosting"}}  # the network's type
{"is_anycast": True}  # anycast space
[{"is_bot": True}, {"is_satellite": True}]  # crawlers, monitors and scanners; satellite space
[{"is_hosting": True}, {"is_cdn": True}]  # traffic from servers, not people
[{"is_vpn": True}, {"is_tor": True}, {"is_resproxy": True}]  # anonymity: a list is OR
{"is_vpn": True, "vpn": {"provider": "nordvpn"}}  # one provider
{"resproxy": {"hits": {"gte": 5}}}  # a numeric threshold

Values are matched by equality, strings without regard to case. A list means any-of. A member the answer holds as a list, such as web's rows or pubproxy's protocols, matches when any one element does: {"web": {"port": 443}}. A dict of gte/gt/lte/lt compares numbers, and every bound you give must hold, so two of them are a range. Members set to False or None are ignored, so a condition states the signals you act on; one that constrains nothing would match every request, and is refused when the middleware is built rather than silently blocking all your traffic.

Replace the refusal with on_blocked, which takes the request and the answer and returns a response:

INTERNETDATA = {
    "api_key": os.environ.get("INTERNETDATA_API_KEY"),
    "block_condition": {"location": {"country": ["CU", "IR", "KP"]}},
    "on_blocked": lambda request, found: render(request, "unavailable.html", status=451),
}
Letting verified crawlers through

"allow_bots": True sends each request's own User-Agent header with its lookup, and a request whose answer verifies that crawler, request.internetdata.result.user_agent.verdict == "verified", is never refused, by block_condition or by block_if; the answer is still attached. A request with no User-Agent sends none. It is off by default, which keeps one cached answer per address rather than one per agent.

INTERNETDATA = {
    "api_key": os.environ.get("INTERNETDATA_API_KEY"),
    "block_condition": {"is_hosting": True},
    "allow_bots": True,
}

With it on, a condition can name the verdict, refusing a forged crawler and a script: {"user_agent": {"verdict": ["spoofed", "not_bot"]}}. Only a paid plan's answer carries user_agent: a keyless client, or a free key past its trial, never gets a verdict and lets no crawler through, and the middleware warns once when that happens.

Blocking one view

block_condition applies to every view. To refuse a visitor on some views only, decorate them, sync or async:

from internetdata_django import block_if


@block_if({"location": {"country": ["CU", "IR", "KP"]}})
def checkout(request): ...

block_if takes the same condition, on_blocked, fail_closed and on_missing_field. It judges the answer the middleware already attached, so a visitor is looked up once however many views check them, and it warns once for a member your plan doesn't include. A request skip claimed reaches the view. The middleware still has to be installed: without it, a decorated view raises ImproperlyConfigured instead of letting everyone through.

Where the client address comes from

This is the setting that decides whether any of the above works, and it is the one thing only you can get right.

By default the middleware uses REMOTE_ADDR, which is the socket peer. Django deliberately does not read X-Forwarded-For for you, because trusting a header without knowing your topology is unsafe. So if your app sits behind nginx, a load balancer, or a CDN, every visitor arrives wearing your proxy's address, and that is the address that gets looked up: every visitor gets your proxy's country and network, and if it is a hosting address, a hosting rule blocks everyone. nginx on the same machine is 127.0.0.1 and a load balancer usually has a private address, which the middleware answers locally without a lookup, as an address with no country, and logs a warning.

For an edge that writes the address into its own header, name the header:

from internetdata_django import header_ip_selector

INTERNETDATA = {
    "api_key": os.environ.get("INTERNETDATA_API_KEY"),
    "ip_selector": header_ip_selector("CF-Connecting-IP"),  # or True-Client-IP, or your own
}

xff_ip_selector() reads X-Forwarded-For directly. Be aware that the left-most entry is whatever the caller sent, because proxies append to that header, so it's only trustworthy when an edge you control overwrites it. If you know how many proxies sit in front, count from the right instead: xff_ip_selector(1) is the address your nearest proxy saw.

Anything else, pass your own callable. It receives the request and returns an address.

If the address resolves to a private one, the middleware says so once through the internetdata logger. That is expected on localhost and is the signal to fix your configuration anywhere else.

When a lookup fails

The request is let through, and the reason is recorded on the answer's error. Our outage should not become yours, so a network failure, a rate limit or a rejected key all fail open. Pass "fail_closed": True to block instead. Private addresses are answered locally and never fail, so this will not lock you out in development.

Cost and latency

Answers are cached for an hour, so a returning visitor costs nothing, and private addresses never leave the process. A cache miss is one request to our API, bounded at 2.5 seconds by default and not retried: on a request path, failing open quickly beats holding a visitor while we try again. Both are adjustable with timeout and retries, and the cache through an InternetData client you build yourself and pass as client.

Skip what you do not care about, or must never refuse:

"skip": lambda request: request.path.startswith("/webhooks/"),

A webhook comes from its sender's servers, an address a hosting rule would refuse. Static files need no skip: runserver, WhiteNoise and a web server in front each answer them before this middleware runs.

Beyond a few million distinct visitors a day, stop calling the API per request: look addresses up locally in our databases instead.

Absent is not false

Unlimited, with a key or without one, leaves out is_vpn, is_hosting, is_cdn, the four proxy flags, is_bot, is_carrier, is_satellite, the service flags (is_ssh, is_smtp, is_web, is_dns_resolver and is_bittorrent), the detail behind them and bot, and the paid members inside location, asn, company and abuse, such as location.city. A field your plan does not include is None, which means "not in your plan" rather than "checked, and no". The exception, until the next major of internetdata, is is_bot, is_carrier, is_satellite and the service flags: they stay plain bools and read False when the answer leaves them out, so result.raw is how you tell a flag the answer carried from one it did not.

request.internetdata.result.flagged("is_vpn")  # False rather than None on a plan without it

A block_condition naming a member your plan does not serve, location.city on Unlimited included, can never match, so the middleware warns once instead of failing silently. Pass "on_missing_field": "raise" to make it an error.

Other Libraries

There are official InternetData client libraries available for many languages including PHP, Python, Go, Java, and Ruby. See our GitHub at https://github.com/internetdata for more.

About InternetData

Geolocation, anonymity, ownership, network, service and domain data for any IP address, AS or domain, by API or as databases you download.

License

This project is licensed under the MIT License.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases internetdata-django

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (1)
Research

Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret Stealing Malware Via GitHub Actions & npm

Vulnerability Insights

Compromised Claude Code extensions (versions 2.1.312 & 2.1.313) in Cursor try to install a backdoor

PolinRider Returns
Research

PolinRider Returns: Hijacked npm Packages Use Ethereum Blockchain to Conceal Malware Infrastructure

Frame 2085668439 (1)
Group 1261154229