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

opscms-erpnext-plugin

Latest version: v2.7.1

Overview

Last scanned
17 Nov 2026
Published
17 Nov 2026
npm package Publisher: puzzo-dev
8 Versions
1.1K Downloads

Scan summary

opscms-erpnext-plugin was last scanned on 17 Nov 2026 at version 2.7.1. Risk score 45 of 100 (medium). High-severity rules fired.

  • Releases: 8 versions; the latest 5 were published within 4 days (14–17 Nov 2026).
  • Findings: 1 rule fired in version 2.7.1 (1 high). The score describes this version only.
  • Downloads: 1,075 downloads.

Versions

8 versions published
Versions and the rules that fired in each
VersionPublishedStatus
2.7.1 LATEST 17 Nov 2026 1 rule fired
2.7.0 16 Nov 2026 1 rule fired
2.6.2 14 Nov 2026 1 rule fired
2.6.1 14 Nov 2026 Not shown
2.6.0 14 Nov 2026 Not shown

Rules fired in 2.7.1: 1

Findings

1 High

Findings for v2.7.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.

Encoded data placed in a DNS lookup

A DNS lookup command (nslookup, dig or host) takes its query name from a subshell that first encodes the data, for example with base64 or xxd. Encoding the name turns a lookup into a way to send data to the nameserver of the queried domain. Ordinary diagnostic lookups have no encoding step.

HIGH
Checking access…

🔒 Create a free account to see all 1 finding with descriptions and instance counts

The score describes 2.7.1; other versions have their own rules, not their own score.

README

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

opscms-erpnext-plugin

A self-contained Payload CMS 3.x plugin for secure, multi-tenant ERPNext integrations.

It provides:

  • ERPNext Connection Configuration per site (multi-tenant) with encrypted credentials.
  • Generic ERP Action Handlers (erp-get, erp-post, erp-patch, erp-delete) registered directly into the CMS workflow engine's action registry.
  • Workflow Step Integration — injects a trigger_erp (Trigger ERP Action) block into the CMS workflows collection steps, with custom field components for live DocType and target field selection.
  • Dead-Letter Queue (erpnext-dead-letters collection) for permanently failed ERPNext requests.
  • Anonymous File Upload endpoint for form attachments (e.g., resumes) with file-type and origin validation.
  • Secure ERPNext Proxy Endpoints (/api/erpnext-proxy/...) with rate-limiting, origin validation, and cross-tenant data isolation.
  • Inbound Sync Rules (erpnext-sync-rules collection) to map ERPNext DocTypes into Payload collections.
  • Inbound Webhook Receiver (/api/erpnext-sync) with HMAC-SHA256 signature verification for ERPNext → Payload sync.
  • Webhook Signature Verification helper for validating incoming ERPNext/Frappe notifications.

[!NOTE] Form-submission-to-ERPNext forwarding is handled by the host application's general Workflows collection (e.g., triggered on collection_change for form-submissions) rather than a dedicated parallel engine.


Table of Contents

  • Installation
  • Quick Start
  • ERPNext OAuth2 Connect
  • Configuration
  • ERPNext Workflow Steps
  • Inbound Sync Rules
  • Security & Access Control
  • Dead-Letter Queue
  • Endpoints
  • Architecture
  • License

Installation

npm install opscms-erpnext-plugin
# or
pnpm add opscms-erpnext-plugin

Quick Start

1. Add the plugin to payload.config.ts

Import and register erpnextPlugin, passing the host application's action registry to enable workflow execution:

import { buildConfig } from 'payload'
import { erpnextPlugin } from 'opscms-erpnext-plugin'
import { actionRegistry } from './lib/actionRegistry' // your host application's registry

export default buildConfig({
  // ... your config
  plugins: [
    erpnextPlugin({
      registry: actionRegistry,
    }),
  ],
})
2. Create an ERPNext Config in the Payload Admin

Go to Integrations → ERPNext Config:

  • Select the site/tenant.
  • Enter the ERPNext URL (HTTPS only).
  • Either enter API Key and Secret manually, or enter the ERPNext username/password of an account with permission to create OAuth Clients and click Connect — see ERPNext OAuth2 Connect below. Both populate the same underlying credentials; pick whichever suits a given site.
  • Companies are fetched automatically once credentials are in place (manual or OAuth) — no separate "fetch companies" step.
  • Mark as Active and Save.
3. Build a Workflow Step

Go to Settings → Workflows:

  • Create or edit a workflow.
  • In Steps, add a Trigger ERP Action (trigger_erp) block.
  • Select the DocType and Action (e.g., POST to create, GET to search).
  • Map fields from the CMS document context using {{doc.fieldName}} variables.

ERPNext OAuth2 Connect

Two ways to authenticate an ERPNext Config, fully interchangeable — pick whichever suits a given site. Both populate the credentials getCredentials()/authHeaders() use, so nothing downstream (the proxy endpoints, workflow ERP actions) needs to know which was used.

Option A — Manual API Key/Secret

Create an API Key/Secret pair in ERPNext under User → API Access, paste them in. Fully supported indefinitely — not a legacy fallback.

Option B — Connect (login-based auto-connect)

There is no manual OAuth Client setup step — no going into ERPNext's admin to register a Client ID/Secret or a redirect URI by hand. Enter the ERPNext username/password of an account with permission to create OAuth Clients (typically an Administrator or System Manager) directly on the erpnext-config document and click Connect:

  1. The plugin logs in to ERPNext via POST /api/method/login using the entered credentials (this call is never stored — only the resulting session is used, transiently, for the next steps).
  2. It looks up an existing OAuth Client via GET /api/resource/OAuth Client, keyed by a deterministic name (IVarse Integration (<site-slug>)) — reused if found, so reconnecting the same site never creates a duplicate Client. If none exists, it creates one via POST /api/resource/OAuth Client with skip_authorization: 1 set, so the end user is never shown a consent screen.
  3. It calls ERPNext's /authorize endpoint server-side using that session. Because skip_authorization is set, ERPNext auto-approves and redirects in a single hop straight to the plugin's redirect_uri with ?code=&state= — there's no separate "approve" confirmation redirect to follow, and that URL is only ever read off the Location header, never actually fetched (it isn't a route the plugin serves). The code is then exchanged for tokens.
  4. The resulting Client ID and Client Secret (auto-populated, read-only, masked in the UI — the user never sees or types these) and the access/refresh token pair are stored (encrypted).
  5. Access tokens are refreshed automatically and transparently by getCredentials() when expired, using the stored refresh token — no user interaction needed after the initial connect.

Manual API Key/Secret fields are not required (and are not cleared) once a config is OAuth-connected — switching back to manual entry is just a matter of leaving OAuth alone and filling those fields in; authMethod only reflects whichever path was used most recently.

The idempotency guarantee (point 2 above) is the reason this is safe to re-run: if an erpnext-config document is ever deleted and recreated for the same site, reconnecting finds and reuses the same OAuth Client by name instead of accumulating orphaned, unused Clients in ERPNext.

Why This Flow Doesn't Need OAuth state Param Signing

A state param exists to protect OAuth flows that redirect the browser out to a third-party authorization server and back — it's what lets the app verify, statelessly, that the request completing the round trip is the same one that started it. ERPNext's auto-connect has no such round trip to protect: it's a single same-origin POST /api/erpnext-oauth/auto-connect, and the browser never leaves the Payload admin. It's protected instead by: requiring an authenticated admin/super-admin Payload session (isAdminOrAbove), and a per-IP rate limit (5 attempts per 60 seconds) against credential-stuffing the ERPNext login step.


Configuration

Plugin Options
import { buildConfig } from 'payload'
import { erpnextPlugin } from 'opscms-erpnext-plugin'
import { actionRegistry, emitSystemEvent, systemEvents, isInternalAuth } from './lib/host' // your host app

export default buildConfig({
  // ... your config
  plugins: [
    erpnextPlugin({
      registry: actionRegistry, // required for workflow ERP actions
      host: {
        emitSystemEvent,        // optional: enables ERPNext connection monitoring
        systemEvents,           // optional: { ERPNEXT_CONNECTION_FAILED, ERPNEXT_CONNECTION_RESTORED }
        isInternalAuth,         // optional: enables /api/erpnext/link-customer
        siteCollectionsMap,     // optional: enables global/local grouping in the Sync Rules collection picker
      },
      enableAnonymousUpload: true, // optional, defaults to true
    }),
  ],
})
Option Type Default Description
registry ActionRegistryRef undefined Required for workflow actions. The action registry to register erp-get, erp-post, erp-patch, and erp-delete handlers.
host ERPNextHostBindings undefined Host-injected automation primitives (emitSystemEvent, systemEvents, isInternalAuth, siteCollectionsMap). Keeps the plugin free of circular imports into the CMS — see Inbound Sync Rules for what siteCollectionsMap does.
enableAnonymousUpload boolean true Registers /api/anonymous-upload for form file attachments.
Environment Variables
Variable Required Description
ERPNEXT_ENCRYPTION_KEY Required 32-byte hex AES-256-GCM key for encrypting credentials at rest. Generate with openssl rand -hex 32.
INTERNAL_API_SECRET Recommended Shared secret for isInternalAuth checks (e.g. /api/erpnext/link-customer). Verified with constant-time comparison.
ERPNEXT_PROXY_KEY Recommended Shared secret for server-to-server proxy access (x-internal-key header). Verified with constant-time comparison.
ERPNEXT_PROXY_REQUIRE_CAPTCHA Optional Set to true to require a reCAPTCHA token on public write operations (/api/erpnext-proxy/submit).
REDIS_URL Optional Enables Redis-backed rate limiting. Recommended for horizontal scaling.
TRUSTED_ORIGINS Optional Comma-separated list of origins allowed for proxy and anonymous upload endpoints.
CORS_ORIGINS Optional Fallback origin allow-list for proxy and anonymous upload endpoints.
PAYLOAD_PUBLIC_SERVER_URL Recommended The CMS public URL; used as a trusted origin for anonymous uploads, and as the redirect_uri registered on each auto-created ERPNext OAuth Client. That URI is never actually hit by a browser (see ERPNext OAuth2 Connect — the whole exchange happens server-side), it just has to match what ERPNext's OAuth2 provider has on file for the request to be accepted.
NEXT_PUBLIC_PAYLOAD_URL Optional Fallback public URL for anonymous upload origin checks.
TRUSTED_PROXY_COUNT Optional Number of trusted proxies in front of the app, used for accurate IP extraction.
ALLOW_PLAINTEXT_ERPNEXT_CREDS Optional Dangerous opt-out: allows storing ERPNext credentials without encryption when no ERPNEXT_ENCRYPTION_KEY is set. Not recommended for production.

ERPNext Workflow Steps

The plugin automatically extends the host's workflows collection steps with the Trigger ERP Action (trigger_erp) block.

Step Fields

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 opscms-erpnext-plugin

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

CVE

Java4Shell (CVE-2026-114938): Easy to Crash, Hard to Exploit — Less Than 0.12% of JVMs Estimated at Risk of RCE

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?

Microsoft's Official agent framework Hijacked
AI & VibeSec

BREAKING: Hijacked Releases of Microsoft’s Official agent-framework Steals Azure and CI Credentials

Frame 2085668439 (1)
Group 1261154229