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

viclix-sdk

Latest version: v0.2.4

Overview

Last scanned
30 Nov 2026
Published
30 Nov 2026
PyPI package Publisher: sizth
4 Versions
390 Downloads

Scan summary

viclix-sdk was last scanned on 30 Nov 2026 at version 0.2.4. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 4 versions; the latest was published on 30 Nov 2026.
  • Findings: No rules fired in version 0.2.4.
  • Downloads: 390 downloads.

Versions

4 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.2.4 LATEST 30 Nov 2026 No rules fired
0.2.3 2 Nov 2026 No rules fired
0.2.2 2 Nov 2026 No rules fired
0.2.1 2 Nov 2026 Not shown

No rules fired in 0.2.4

Findings

Findings for v0.2.4. 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 0.2.4; other versions have their own rules, not their own score.

README

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

viclix-sdk

Traffic logging for FastAPI apps, ready to visualize in Viclix.

Installs an ASGI middleware that records every request (IP, user, endpoint, time, duration, status…) into a dedicated JSONL file. Writing happens on a background thread with the file kept open, so the request path never does disk I/O. Those logs then feed the animated Viclix visualization: who came in, from which IP, to which pages and in what order.

Installation

pip install viclix-sdk

Minimal usage

from fastapi import FastAPI
from viclix_sdk import MiddlewareLogger

app = FastAPI()
app.add_middleware(MiddlewareLogger)

That already creates the vclx/middleware/ folder and writes traffic-YYYY-MM-DD.jsonl there.

Configuration

app.add_middleware(
    MiddlewareLogger,
    log_path="vclx/middleware/traffic.jsonl",  # base path (the date is appended)
    trust_proxy=True,                       # real IP from X-Forwarded-For (PythonAnywhere)
    rotation="daily",                       # "daily" or None
    include_query=False,                    # include the query string (careful with sensitive data)
    ignore_paths=["/static", "/health"],    # prefixes that are not logged
)
Parameter Default Description
log_path vclx/middleware/traffic.jsonl Base path of the log.
trust_proxy True Reads the IP from X-Forwarded-For / X-Real-IP.
user_resolver reads request.state.user Callable[[scope], id] to extract the user.
rotation "daily" Daily file rotation, or None.
include_query False Includes the query string in the event.
ignore_paths [] Path prefixes to ignore.
track_sessions True Anonymous session cookie (viclix_sid) per visitor.
session_cookie "viclix_sid" Name of the session cookie.
session_ttl_days 365 Lifetime of the session cookie.
Sessions (trace a visitor's flow)

With track_sessions=True (the default), each visitor gets an anonymous viclix_sid cookie and every event carries a session field. This lets you follow a single visitor's full sequence of pages even without a login — for example, to see the flow that led a user to a 4xx/5xx error:

GET /            -> 200   sess=44ef64b0
GET /checkout    -> 200   sess=44ef64b0
GET /boom        -> 500   sess=44ef64b0   ← the flow that ended in an error
Identifying the user

By default request.state.user is read (whatever your auth layer leaves there). If you store an object, username, email, id, pk are tried in order. For custom logic:

def resolver(scope):
    state = scope.get("state") or {}
    user = state.get("user")
    return getattr(user, "email", None)

app.add_middleware(MiddlewareLogger, user_resolver=resolver)

Rotation and retention (log size)

By default logs rotate hourly, closed files are compressed to .gz and deleted after 24 h:

app.add_middleware(
    MiddlewareLogger,
    rotation="hourly",       # "hourly" (default) | "daily" | None
    retention_hours=24,      # delete files older than this (None = no limit)
    max_total_mb=200,        # hard size cap: deletes the oldest (None = no cap)
    compress=True,           # gzip already-rotated files
)
  • retention_hours bounds by time; max_total_mb is the safety net by size (a traffic spike or a bot can fill the disk within the retention window).
  • Cleanup and compression run on the background thread at rotation time — never on the request path — and only touch the log's own files.
  • The viewer reads .jsonl and .jsonl.gz transparently.

The biggest saving is usually not logging static assets:

app.add_middleware(MiddlewareLogger, ignore_paths=["/static", "/assets", "/favicon.ico"])

Background tasks accept the same parameters:

track_background_tasks(name="checkout", rotation="hourly", retention_hours=24)

SQL queries (SQLAlchemy)

From the outside you see that a request took 2 s; never why. With one line every event starts carrying the detail of what it did against the database:

from viclix_sdk import track_db_queries

track_db_queries()              # every engine in the process
track_db_queries(engine)        # or just one

No query is touched: it hooks SQLAlchemy's before/after_cursor_execute events. It does not write a line per query — that would multiply the volume. It aggregates per request (and per background task) and attaches it as the db field of the event that was already being emitted:

"db": {"n": 21, "ms": 312.4, "slow": 2,
       "slowest_ms": 40.1, "slowest": "SELECT id FROM projects",
       "repeat": {"sql": "SELECT name FROM projects WHERE id = ?", "n": 20, "ms": 180.2}}

repeat is the N+1 detector: the same query —normalized, without values— repeated many times within the same request. In the viewer, endpoints with N+1 are flagged with ⚠ and the average number of queries.

Only the text of the statement is stored, never the parameters: in SQLAlchemy the values travel separately (bind params), so no data leaks.

Options: slow_ms (slow-query threshold, 100 by default), repeat_threshold (repeats needed to flag N+1, 5) and max_distinct (cap on distinct queries tracked per request, 200).

Exceptions

A 500 seen from the outside is an identical black box every time. The middleware captures unhandled exceptions —the only place where the traceback still exists— and adds them to the event, attributed to the endpoint, the IP and the user:

"error": {"type": "ValueError", "msg": "something broke badly",
          "where": "routes.py:142 in checkout", "traceback": "Traceback ..."}

Enabled by default (capture_errors=True) and it does not alter the flow: the exception is re-raised as-is. With error_traceback=False only the type, message and file:line are stored. Background tasks that fail log the same in their own log (and are not duplicated in the request that created them).

No local variables are captured, only the formatted traceback.

External services (httpx / requests)

From the outside you can't attribute "checkout was slow because Stripe took 3 s": the proxy only sees a slow request. With one line:

from viclix_sdk import track_outbound_calls

track_outbound_calls(slow_ms=500)

Wraps httpx.Client.send, httpx.AsyncClient.send and requests.Session.send. Like the SQL one, it aggregates per request/task and travels as the out field:

"out": {"n": 2, "ms": 3200.5, "slow": 1,
        "hosts": [{"host": "api.stripe.com", "n": 1, "ms": 3000.2}],
        "slowest": {"host": "api.stripe.com", "method": "POST",
                    "path": "/v1/charges", "ms": 3000.2, "status": 200}}

From the URL, host and path are kept; the query string is dropped because it usually carries tokens and API keys. In the viewer there is a port (🛰) where the little person waits as long as each third party took.

With streaming responses the timing reaches the headers, not the last byte of the body.

Process health

This one does go to its own log (vclx/health/<name>.jsonl), because it doesn't hang off any request: it's periodic sampling.

from viclix_sdk import track_health

track_health(name="www", interval=15)
{"kind": "health", "app": "www", "loop_lag_ms": 3.4,
 "rss_mb": 182.5, "threads": 12, "in_flight": 2,
 "pool": {"in_use": 3, "size": 5, "overflow": 0}}

The key figure is loop_lag_ms: how long the event loop takes to attend to something that was already ready. From the outside you only see "high latency"; the lag tells you there's a synchronous call blocking the async loop. It's measured from the sampling thread with loop.call_soon_threadsafe, so it takes no room in the loop itself.

rss_mb uses psutil if installed, otherwise /proc/self/statm (Linux). pool comes from the first SQLAlchemy engine seen in use, so it needs track_db_queries() active. In the viewer this is the city's weather: it clouds over and rains when the process is suffering.

Hung requests and who is blocking the loop

Two parameters of track_health, no new lines:

track_health(name="www", stuck_after=30, profile_on_lag=200)

stuck_after (seconds) reports requests that are still in flight. It's the only way to see a request that never finishes: the normal event is written when it ends, so a deadlock or a third party with no timeout left no trace at all. They show up in the health sample while they're still hung:

"stuck": [{"method": "GET", "path": "/pay/charge", "ip": "1.2.3.4", "age_s": 47.2}]

profile_on_lag (ms) takes the snapshot of the stacks when the loop stalls. The trick is in the ordering: the probe waits only that long and, if the ping hasn't come back, the loop is blocked right now — that's the moment to photograph. Waiting for it to return would give the stack of the loop already at rest, which says nothing.

"blocked_by": "billing.py:61 in summarize",
"stacks": [{"thread": "MainThread", "stack": ["...", "billing.py:61 in summarize"]}]

Cache (Redis)

from viclix_sdk import track_cache
track_cache()               # redis.Redis and redis.asyncio.Redis
track_cache(my_client)      # or just that client

cache field on the event: {"n": 10, "hits": 8, "misses": 2, "ms": 4.1}. From the outside you can't tell a cached response from a recomputed one. Only the command is counted, never the key or the value.

Authentication and security

from viclix_sdk import track_security
track_security(name="www", login_paths=["/login", "/signup"])

Its own log (vclx/security/<name>.jsonl), 30-day retention. Detects without touching your code: unauthorized (401), denied (403), login.failed and login.ok on the login paths.

The important part is that it can be grouped by account: an attacker rotating IPs against a single user is invisible grouped by IP and obvious by account.

Honest limit: from the middleware only the status code is visible. The reason (wrong password vs. locked account vs. expired token) is only known by your auth layer. For that there's an optional call wherever it matters:

from viclix_sdk import record_auth
record_auth("login.failed", user=email, reason="bad_password")

When used, the automatic detection stays quiet for that request, so the same attempt isn't logged twice.

Startup, shutdown and deploy

from viclix_sdk import track_lifecycle
track_lifecycle(name="www", version=settings.release, config=settings)

Its own tiny log: one or two lines per deploy. From the outside a redeploy and a crash-loop look identical; here they're told apart because a start without its preceding stop means the previous process died dirty (SIGKILL, OOM). No signal handlers are installed, so as not to step on uvicorn's.

From the config, the names of non-sensitive keys and a fingerprint of all values are stored — never the values. If the fingerprint changes between two starts of the same version, someone touched the configuration.

Response sizes

Runs on its own, with no configuration: a bytes field on every event. Detects the endpoint returning 4 MB of unpaginated JSON. Disable with MiddlewareLogger(track_bytes=False).

Unlike the rest of this README, this one isn't exclusive to the inside: your proxy sees the bytes too. It's here because it's free.

Viewer inside your app (no CLI)

Two lines and you have the viewer on your own domain, without starting anything:

from viclix_sdk import mount_viewer
mount_viewer(app, "/_viclix", token=settings.viclix_token)

You get yourdomain.com/_viclix and yourdomain.com/_viclix/experimental.

Only your admins, no token
mount_viewer(app, "/_viclix", authorize=my_admin_check)

authorize receives the ASGI scope and returns True/False; from there you read the session cookie just like in user_resolver. If you pass both, whoever satisfies either gets in.

What it does for security
  • The token disappears from the URL. When you arrive with a valid ?token=… it's stored in an HttpOnly; SameSite=Strict; Path=<viewer> cookie and you're redirected to the same path without the query. The token appears once and is not left in history, nor in the Referer of later requests, nor in the proxy logs.
  • It responds 404, not 401. Whoever lacks the key doesn't know the viewer exists.
  • It fails closed. With no token and no authorize, or with a token shorter than 16 characters, mount_viewer raises ValueError at startup instead of serving the logs to anyone. Generate the token with secrets.token_urlsafe(32).
  • Constant-time comparison (hmac.compare_digest).
  • Failed attempts are logged as viewer.denied in the security log, if track_security() is active.
  • The viewer does not log itself: browsing it does not generate the events you're looking at.
What it does NOT do

It doesn't encrypt anything or rate-limit attempts. And above all: these logs carry emails, tracebacks, SQL statements, IPs and config key names. Mount it only behind HTTPS and treat it like an admin panel, because that's exactly what it is.

Live business stats (numbers, not traffic)

Everything above is observability — traffic, SQL, errors. This is the other board every admin has: your numbers ("total users", "active polls", "revenue"). Declare them once and you get a live page and a token-protected JSON feed a central dashboard can pull:

from viclix_sdk import mount_stats, Metric

mount_stats(
    app,
    "/_stats",
    token=settings.stats_token,          # 16+ chars; the dashboard uses this
    title="Judgly",
    metrics=[
        Metric("users",  "Total Users",  lambda: db.query(User).count(),          icon="users"),
        Metric("polls",  "Active Polls", lambda: active_poll_count(),              icon="bar"),
        Metric("votes",  "Total Votes",  lambda: total_votes(),                    icon="heart"),
        Metric("econ",   "Economy",      lambda: {"purchased": p, "spent": s},     icon="coin", fmt="money"),
    ],
)

You get two routes:

  • GET /_stats — a self-contained live page (cards + an activity feed synthesised from the polled diffs, exactly like the hand-rolled admin pages it replaces). Gated by the token or authorize.
  • GET /_stats/api — the same numbers as JSON. Gated by the token (?token=, the X-Viclix-Token header, or the cookie the page sets). This is what the fleet dashboard (viclix stats) pulls from every app.

Metric.fn is a plain callable returning a number, a string, or a dict for a multi-value tile. fmt is "int" (default) / "float" / "money" / "raw".

It won't hammer your DB. Metric callables run at most once per cache_seconds (10 by default), so a 3-second poll still hits the database only every 10 s. A callable that raises is caught per metric — its value becomes null with an error — instead of taking down the whole feed.

Security is the same as mount_viewer. Constant-time token compare; the token is swapped for an HttpOnly; SameSite=Strict cookie and dropped from the URL; a missing/wrong token gets 404, not 401. With neither token nor authorize, mount_stats raises at startup — it fails closed. Let your logged-in admins see the page without the token via authorize=fn(scope)->bool (same signature as the viewer's), while the dashboard keeps using the token for the JSON.

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 viclix-sdk

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

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

PolinRider Returns
Research

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

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Vulnerability Insights

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?

Frame 2085668439 (1)
Group 1261154229