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

@zerotal/auth

Latest version: v1.18.2

Overview

Last scanned
26 Nov 2026
Published
26 Nov 2026
npm package Publisher: mbilisphe13
2 Stars
0 Forks
50 Versions
2.3K Downloads
TypeScript Repo language

Scan summary

@zerotal/auth was last scanned on 26 Nov 2026 at version 1.18.2. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 50 versions; the latest 5 were published within 2 days (25 and 26 Nov 2026).
  • Findings: No rules fired in version 1.18.2.
  • Downloads: 2,327 downloads.

Versions

50 versions published
Versions and the rules that fired in each
VersionPublishedStatus
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

No rules fired in 1.18.2

Findings

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.

README

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

@zerotal/auth

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.

Installation

bun add @zerotal/session @zerotal/auth

Setup

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

Usage

The User model

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;
}
The Auth facade
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 */
}
Authorization (Gate, roles & permissions)

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);
API tokens & route protection
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");
});

Exports

  • Models & facades — AuthUser, Authenticatable, Auth, Hash
  • Provider & config — AuthProvider, AuthConfig
  • Middleware — PersistUserMiddleware (auto-wired; populates ctx.user), AuthMiddleware (guard — require auth), GuestMiddleware, BearerTokenMiddleware, TwoFactorMiddleware, ValidateSignatureMiddleware
  • Authorization — Gate, GateService, Policy, RequireRoleMiddleware, RequirePermissionMiddleware
  • Relational RBAC — Role, Permission, Roles, Permissions (mixins), PermissionRegistry, definePermission
  • Hashing — HashService
  • Tokens — createToken, hashToken, tokenCan
  • Password reset — PasswordBroker, PASSWORDS
  • Magic links — MagicLinkBroker, MAGIC
  • Two-factor — TwoFactorService, TwoFactor
  • WebAuthn / passkeys — PasskeyService. Its library is not installed with this package: an app that uses passkeys adds it with bun add @simplewebauthn/server reflect-metadata.

Documentation

  • Authentication
  • Authorization
  • Password Reset
  • Email Verification
  • Roles & Two-Factor

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 @zerotal/auth

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

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

PolinRider Returns
Research

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

Frame 2085668439 (1)
Group 1261154229