Scan your whole stack
From OX Research Newsroom
Are you using @zerotal/auth?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v1.18.2
@zerotal/auth was last scanned on 26 Nov 2026 at version 1.18.2. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 1.18.2 LATEST | 26 Nov 2026 | No rules fired |
| 1.18.1 | 26 Nov 2026 | No rules fired |
| 1.18.0 | 26 Nov 2026 | No rules fired |
| 1.17.4 | 26 Nov 2026 | Not shown |
| 1.17.3 | 25 Nov 2026 | Not shown |
Findings for v1.18.2. 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.18.2; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Session authentication, API tokens, and DB-backed authorization for Zerotal.
@zerotal/auth authenticates users against the HTTP session, issues and verifies bearer API tokens, and provides Gate/policy authorization with relational roles and permissions. It also ships password hashing, password reset, magic-link login, TOTP two-factor authentication, and WebAuthn passkeys. It builds on @zerotal/session — register both providers.
Part of the Zerotal framework. Requires Bun ≥ 1.3.14.
bun add @zerotal/session @zerotal/auth
Register the provider in bootstrap/providers.ts (after SessionProvider):
import { SessionProvider } from "@zerotal/session";
import { AuthProvider } from "@zerotal/auth";
export default [
// …other providers
SessionProvider,
AuthProvider,
];
That's it — AuthProvider discovers your authenticatable model from the registry,
so ctx.user / Auth.user() work with no further wiring. To override how a user is
loaded from the session ID (in bootstrap/app.ts, before Application.create()):
import { AuthProvider } from "@zerotal/auth";
import { User } from "../app/models/User.ts";
AuthProvider.resolveUsing((id) => User.find(id)); // optional
Extend AuthUser instead of Model:
import { column, table } from "@zerotal/orm";
import { AuthUser } from "@zerotal/auth";
@table("users")
export class User extends AuthUser {
@column() name!: string;
@column() email!: string;
@column() password!: string;
}
import { Auth, Hash } from "@zerotal/auth";
Auth.check(); // boolean — authenticated?
Auth.user(); // User — throws UnauthorizedError for guests
Auth.userOrNull(); // User | undefined
Auth.id(); // number
await Auth.login(user); // write user_id to the session
await Auth.logout(); // clear it
// Verify a password during login:
if (!(await Hash.check(password, user.password))) {
/* invalid */
}
Compose the Authenticatable / Roles / Permissions mixins onto your
model with Model.using (flat, left-to-right — no wrapper nesting):
import { Authenticatable, Roles, Permissions } from "@zerotal/auth";
import { Model, column } from "@zerotal/orm";
export class User extends Model.using(Authenticatable, Permissions, Roles) {
@column() name!: string;
@column() email!: string;
}
// `extends Roles(Permissions(AuthUser))` still works — AuthUser is
// just Authenticatable(Model).
// Then:
await user.assignRole("editor");
user.can("post.update"); // synchronous — resolves direct + role-derived grants
Auth.authorize("post.delete"); // throws ForbiddenError when denied
// Policy-based checks:
Gate.allows("update", post);
Gate.authorize("update", post);
import { createToken, BearerTokenMiddleware } from "@zerotal/auth";
import { DB } from "@zerotal/orm";
const { plaintext } = await createToken({
tokenableId: user.id,
name: "cli",
abilities: ["*"],
store: (row) => DB.table("personal_access_tokens").insert(row),
});
// return `plaintext` to the client once
Router.group({ prefix: "/api", middleware: [BearerTokenMiddleware] }, () => {
Router.get("/me", UserController, "show");
});
AuthUser, Authenticatable, Auth, HashAuthProvider, AuthConfigPersistUserMiddleware (auto-wired; populates ctx.user), AuthMiddleware (guard — require auth), GuestMiddleware, BearerTokenMiddleware, TwoFactorMiddleware, ValidateSignatureMiddlewareGate, GateService, Policy, RequireRoleMiddleware, RequirePermissionMiddlewareRole, Permission, Roles, Permissions (mixins), PermissionRegistry, definePermissionHashServicecreateToken, hashToken, tokenCanPasswordBroker, PASSWORDSMagicLinkBroker, MAGICTwoFactorService, TwoFactorPasskeyService. Its library is not installed with this package:
an app that uses passkeys adds it with bun add @simplewebauthn/server reflect-metadata.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.
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).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.