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

@lark-apaas/express-core

Latest version: v1.0.12-beta.0

Overview

Last scanned
26 Nov 2026
Published
26 Nov 2026
npm package Publisher: byted.lycoiref, bytedance-npm-team, duanlikang_byte, fengtianran_byted, xiaochuanzhang_byted
67 Versions
7.5K Downloads

Scan summary

@lark-apaas/express-core was last scanned on 26 Nov 2026 at version 1.0.12-beta.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 67 versions; the latest 5 were published within 6 days (21–26 Nov 2026).
  • Findings: No rules fired in version 1.0.12-beta.0.
  • Downloads: 7,510 downloads.

Versions

67 versions published
Versions and the rules that fired in each
VersionPublishedStatus
1.0.12-beta.0 LATEST 26 Nov 2026 No rules fired
1.0.12-alpha.20261126072820 26 Nov 2026 No rules fired
1.0.12-alpha.20261123035103 23 Nov 2026 No rules fired
1.0.12-alpha.20261121081951 21 Nov 2026 Not shown
1.0.12-alpha.20261121033608 21 Nov 2026 Not shown

No rules fired in 1.0.12-beta.0

Findings

Findings for v1.0.12-beta.0. 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.0.12-beta.0; other versions have their own rules, not their own score.

README

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

@lark-apaas/express-core

Express 技术栈的平台核心框架,通过 setup() 一次性注册所有平台中间件,将平台逻辑与业务逻辑在框架层解耦。

功能特性

  • 自动注册平台中间件链(UserContext、CSRF、RLS、ViewContext)
  • 集成 DataPaaS 数据库连接管理与 RLS 支持
  • CSRF Token 生成与验证
  • 应用元数据自动注入到模板渲染上下文
  • ESM live binding 导出 db 实例,使用体验与社区一致

安装

npm install @lark-apaas/express-core
Peer Dependencies
npm install drizzle-orm@0.44.6 express

快速开始

1. 初始化应用
// app.ts
import express from 'express';
import { setup } from '@lark-apaas/express-core';

const app = express();
const { close } = setup(app);

// 业务路由
app.get('/api/users', async (req, res) => { ... });

app.listen(3000);
process.on('SIGTERM', () => close());
2. 使用数据库
// routes/users.ts
import { db } from '@lark-apaas/express-core';
import { users } from '../schema';

router.get('/users', async (req, res) => {
  const result = await db.select().from(users);
  res.json(result);
});
3. 访问用户上下文
app.get('/api/profile', (req, res) => {
  const { userId, tenantId, roles } = req.userContext;
  res.json({ userId, tenantId, roles });
});
4. 访问平台数据(模板渲染)
app.get('/', (req, res) => {
  // res.locals 已自动注入 appName, csrfToken 等
  res.render('index');
});

API 参考

setup(app, config?)

初始化 Express 应用,注册所有平台中间件。

参数:

参数 类型 说明
app express.Application Express 实例
config SetupConfig 可选配置

返回值: { close: () => Promise<void> } — 用于优雅关闭数据库连接。

SetupConfig:

字段 类型 默认值 说明
database.connectionString string process.env.DATABASE_URL PostgreSQL 连接串
database.schema object - Drizzle schema
database.maxConnections number 7 最大连接数
csrf.enabled boolean true 是否启用 CSRF 保护
csrf.cookieKey string 'suda-csrf-token' CSRF cookie 名称
csrf.headerKey string 'x-suda-csrf-token' CSRF header 名称
csrf.routes string[] ['/api/*'] CSRF 验证路由
bodyLimit string '1mb' body parser 大小限制
db

通过 ESM live binding 导出的 Drizzle 数据库实例。setup() 调用后可用。

import { db } from '@lark-apaas/express-core';
中间件(高级用法)

各中间件也单独导出,供高级用户自行组合:

import {
  userContextMiddleware,
  createCsrfTokenMiddleware,
  createCsrfValidationMiddleware,
  createViewContextMiddleware,
} from '@lark-apaas/express-core';

setup() 注册的中间件顺序

顺序 中间件 作用域 说明
1 body parser 所有路由 JSON + URL-encoded 解析
2 cookie-parser 所有路由 Cookie 解析
3 userContextMiddleware 所有路由 从请求头解析用户上下文
4 DataPaaS + RLS 所有路由 数据库连接 + 行级安全
5 csrfTokenMiddleware 所有路由 生成 CSRF Token
6 csrfValidationMiddleware /api/* 验证 CSRF Token
7 viewContextMiddleware 所有路由 注入应用元数据到渲染上下文

req 扩展字段

字段 类型 来源
req.userContext UserContext userContextMiddleware
req.csrfToken string csrfTokenMiddleware
req.__platform_data__ object viewContextMiddleware

注意事项

  1. setup() 必须在注册业务路由之前调用
  2. db 在 setup() 调用前为 undefined
  3. 不传 database.connectionString 时自动读取 process.env.DATABASE_URL
  4. drizzle-orm 必须为 0.44.6 版本

License

MIT

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 @lark-apaas/express-core

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 (3)
Research

Ruby2Shell: Ruby Memory Corruption Flaws Expose Applications to Remote Code Execution, But is it an Actual Risk?

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Critical Apache HTTP Server Flaw Exposes Web Servers to RCE (1)
CVE

CVE-2026-119618: Critical Apache HTTP Server Flaw Exposes Web Servers to Remote Code Execution

Frame 2085668439 (1)
Group 1261154229