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

@qelos/integrator-fastify

Latest version: v4.5.1

Overview

Last scanned
28 Nov 2026
Published
28 Nov 2026
npm package Publisher: davidmeirlevy
6 Versions
327 Downloads

Scan summary

@qelos/integrator-fastify was last scanned on 28 Nov 2026 at version 4.5.1. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 6 versions; the latest 2 were published on 28 Nov 2026.
  • Findings: No rules fired in version 4.5.1.
  • Downloads: 327 downloads.

Versions

6 versions published
Versions and the rules that fired in each
VersionPublishedStatus
4.5.1 LATEST 28 Nov 2026 No rules fired
4.5.0 28 Nov 2026 No rules fired
4.4.0 16 Nov 2026 No rules fired
4.3.1 4 Oct 2026 Not shown
4.2.2 17 Sep 2026 Not shown

No rules fired in 4.5.1

Findings

Findings for v4.5.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 4.5.1; other versions have their own rules, not their own score.

README

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

@qelos/integrator-fastify

Fastify integrator for Qelos. It plugs into a Fastify app to make the Node host act as a same-origin BFF for a managed Qelos app: requests under /api/** are proxied to Qelos, and every other request resolves the current user up front so your route handlers can use request.qelos.user / request.qelos.workspace / request.qelos.workspaces / request.qelos.sdk directly.

Install

npm install @qelos/integrator-fastify @qelos/sdk
# fastify is a peer dependency
npm install fastify

Requires Node 18+ — the plugin uses Response.headers.getSetCookie() to pipe individual upstream Set-Cookie headers back to the client.

Quick start

import Fastify from 'fastify';
import qelosFastify, { requireUser } from '@qelos/integrator-fastify';

const app = Fastify();

await app.register(qelosFastify, {
  config: {
    appUrl: process.env.QELOS_APP_URL!, // e.g. https://yourdomain.com
  },
});

// User-defined routes still take precedence — register them BEFORE listening,
// they win over the wildcard `/api/*` proxy in Fastify's radix-tree router.
app.get('/me', async (request) => ({
  user: request.qelos.user,
  workspace: request.qelos.workspace,
}));

// Short-circuit anonymous requests with 401:
app.get(
  '/private',
  { preHandler: requireUser },
  async (request) => request.qelos.user,
);

await app.listen({ port: 3000 });

API proxy

When the plugin is registered with disableProxy !== true, it installs a catch-all /api/* route that transparently proxies any /api/** request the consuming app does not handle itself to the configured Qelos managed-app origin. This lets the Fastify app act as a same-origin BFF: @qelos/sdk calls from the browser, server, or the Qelos web SDK can all hit /api/... on the Fastify host and reach Qelos without CORS or cross-site cookie pain.

User-defined routes still take precedence — Fastify's radix-tree router matches more specific routes (/api/users) before the wildcard (/api/*), so the proxy only catches requests no other handler matched.

Cookie domain rewrite

The proxy forwards the incoming Cookie header as-is (the Qelos session cookie name is treated as opaque) and forwards upstream Set-Cookie headers back to the client, rewriting the Domain= attribute on every upstream cookie to the inbound request's own host. That way the session cookie set by Qelos is valid on the Fastify app's domain regardless of which host Qelos issues cookies from.

Resolving the proxy target

The managed Qelos app URL (config.appUrl) is the proxy target. Env vars are only dev-time overrides for when the configured appUrl isn't reachable from the local host:

  1. QELOS_PROXY_TARGET env var.
  2. QELOS_IP env var (dev fallback).
  3. QELOS_API_IP env var (dev fallback).
  4. config.appUrl.

If none of these are set, the proxy handler responds with 503 so misconfiguration fails loudly.

Opting out

Set disableProxy: true on the config to skip registration of the proxy route — useful when the Fastify app implements every /api/* route itself or terminates the proxy elsewhere (CDN, reverse proxy, etc.). When the proxy is disabled, /api/ is not auto-added to skipPaths, so the user-resolution preHandler runs on /api/* routes you handle yourself.

WebSocket upgrades are not proxied; route them explicitly if needed.

Plugin behavior

On every non-/api/ request, the plugin's preHandler hook identifies the current user by calling the managed Qelos app directly:

  1. Resolve the upstream origin the same way the /api/** proxy does (QELOS_PROXY_TARGET → QELOS_IP → QELOS_API_IP → config.appUrl).
  2. Issue fetch('${upstream}/api/me') with the incoming request's Cookie header forwarded verbatim — the Qelos session cookie name is opaque to the integrator, so the whole header is piped through unchanged. Any incoming Authorization header is forwarded too.
  3. For every Set-Cookie header on the upstream response, rewrite the Domain= attribute to the inbound request's Host (port stripped) and append it to the outgoing response. This is how session rotations from Qelos reach the browser when the managed app and the Fastify host live on different origins.
  4. On 2xx, parse the JSON body and expose it as request.qelos.user. On any other status (or a network error), leave user = null — and respond with 401 if requireAuth is set.

The preHandler is independent from the /api/** proxy: the proxy handles forwarding of API calls themselves, while the preHandler identifies the user on every page/non-API request before your route handlers run. To avoid double-hitting Qelos for /api/me (once for proxying, once for user resolution), the plugin adds /api/ to skipPaths automatically when the proxy is enabled.

The plugin does not attempt to strip the Secure attribute from rotated cookies. In local dev over plain HTTP, browsers will drop Secure cookies — configure the managed Qelos app to issue non-Secure cookies in that environment, or run the Fastify host over HTTPS.

Use in route handlers

request.qelos is augmented onto the Fastify FastifyRequest type and gives you a typed QelosRequestContext:

field description
user The IUser body returned by /api/me, or null when anonymous.
workspace The active IWorkspace for the request, or null.
workspaces All workspaces the user has access to.
sdk A request-scoped QelosSDK instance bound to the live cookies.
app.get(
  '/products',
  { preHandler: requireUser },
  async (request) => request.qelos.sdk.entities('products').getList(),
);

The sdk reads cookies from the current request on every call, so any session rotation piped through by the plugin is picked up automatically by subsequent SDK requests in the same handler.

Workspace resolution

request.qelos.workspace defaults to whatever the managed Qelos app reports on user.workspace from /api/me. That field is non-null only when the user has already activated a workspace on the Qelos side; when it is null, the frontend is expected to prompt the user to either activate an existing workspace or create a new one. The plugin deliberately does not auto-pick workspaces[0] — that would silently put the user into the wrong workspace.

To override the default (e.g. force a particular workspace per request), pass a resolveWorkspace callback:

await app.register(qelosFastify, {
  config: { appUrl: process.env.QELOS_APP_URL! },
  resolveWorkspace: ({ request, user, workspaces }) => {
    const headerId = request.headers['x-qelos-workspace'];
    return (
      workspaces.find((w) => w._id === headerId) ||
      user.workspace ||
      null
    );
  },
});

Configuration

await app.register(qelosFastify, {
  config: {
    appUrl: 'https://yourdomain.com', // required

    // Service-to-service: use a static API token instead of cookies.
    apiToken: process.env.QELOS_API_TOKEN,

    // Reject anonymous requests with 401. Defaults to false.
    requireAuth: false,

    // Skip the user-resolution preHandler for these path prefixes.
    skipPaths: ['/health', '/metrics'],

    // Skip registration of the catch-all `/api/*` reverse proxy route.
    // When true, `/api/` is also NOT auto-added to skipPaths.
    disableProxy: false,

    // Anything you want passed through to the per-request SDK.
    sdkOptions: {},
  },
});

appUrl may also be omitted from config and passed at the top level — both of these shapes are accepted:

await app.register(qelosFastify, {
  appUrl: 'https://yourdomain.com',
  apiToken: process.env.QELOS_API_TOKEN,
});

API token mode

For service-to-service deployments where every request shares one Qelos API token, set apiToken and the plugin will skip the cookie flow entirely and build an SDK that authenticates with the static token:

await app.register(qelosFastify, {
  config: {
    appUrl: process.env.QELOS_APP_URL!,
    apiToken: process.env.QELOS_API_TOKEN,
  },
});

Local development without a Qelos tenant

Install the optional @qelos/testing package and enable mock mode. The /api/** proxy then answers from an in-process mock of the Qelos API (auth, workspaces, personas, entities, ...) instead of forwarding upstream, and request.qelos / the per-request SDK talk to the same mock, with no network involved.

npm i -D @qelos/testing
await app.register(qelosFastify, {
  config: {
    appUrl: process.env.QELOS_URL ?? '',
    // true | folder with `qelos pull` / `qelos dump` artifacts + state | MockQelosOptions
    mock: process.env.NODE_ENV !== 'production' ? './.qelos-mock' : false,
  },
});

You can also enable it with the environment: QELOS_MOCK=1, QELOS_MOCK=true or QELOS_MOCK=./path/to/folder (folder with qelos pull / qelos dump artifacts and mock state). An explicit mock config wins over the env.

  • fastify.qelosMock is the mock controller: await fastify.qelosMock.get() resolves to the @qelos/testing instance (state, ...) for programmatic control in dev.

  • The mock is created lazily, once per config, and shared by the proxy and the per-request SDK.

  • If mock mode is requested but @qelos/testing is not installed, requests fail with a clear error. Production bundles without it keep working because the package is only imported dynamically when mock mode is on.

  • Production guard: with NODE_ENV=production mock mode is ignored (a warning is logged) unless you pass mock: { allowInProduction: true }. A banner is logged whenever the mock is active.

Version support

Runtime Supported versions
Node.js >= 18
Fastify 4.x, 5.x (peer: `^4.0.0

Unit tests run against both Fastify 4 and 5 (pnpm run test:4 / pnpm run test:5).

Requirements

  • Node.js >= 18 (uses global fetch and Headers.getSetCookie).
  • Fastify 4 or 5.

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).

  • npm @qelos/integrator-fastify

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

Vulnerability Insights

OpenSSH Password Authentication Bypass on Alpine Linux (*sshole) – CVE-2026-123158

PolinRider Returns
Research

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

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

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Frame 2085668439 (1)
Group 1261154229