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

@einvoice-ts/parser

Latest version: v0.5.1

Overview

Last scanned
29 Nov 2026
Published
29 Nov 2026
npm package Publisher: albertfdp
0 Stars
0 Forks
4 Versions
TypeScript Repo language

Scan summary

@einvoice-ts/parser was last scanned on 29 Nov 2026 at version 0.5.1. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 4 versions, all published on 29 Nov 2026.
  • Findings: No rules fired in version 0.5.1.

Versions

4 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.5.1 LATEST 29 Nov 2026 No rules fired
0.5.0 29 Nov 2026 No rules fired
0.4.1 29 Nov 2026 No rules fired
0.4.0 29 Nov 2026 Not shown

No rules fired in 0.5.1

Findings

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

README

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

@einvoice-ts/parser

Namespace-aware, schema-driven UBL XML parser for Peppol BIS Billing 3.0 documents: XML in, Unchecked* model plus structural diagnostics out. Depends on @einvoice-ts/core and @rgrove/parse-xml (the only third-party runtime dependency in the monorepo).

Part of einvoice-ts. To parse and validate in one call, use validateXml() from einvoice-ts. Guide: parsing, validating and serializing.

Install

pnpm add @einvoice-ts/parser

Parsing

import { parse, parseCreditNote, parseInvoice } from '@einvoice-ts/parser';

const { diagnostics, document, ok } = parse(xml);

document.kind; // 'Invoice' | 'CreditNote'
ok; // no diagnostic is fatal

parse() reads the document element to decide which kind it is; parseInvoice() and parseCreditNote() narrow the result and throw a DocumentKindError when the document is the other one. The model is always returned, however wrong the document is, so that one parse plus one validation report every problem at once.

Three things are thrown rather than reported, because they are about the call and not about the document's contents:

Error When
XmlSyntaxError the text is not well-formed XML, or nests deeper than 1,000 levels
UnsupportedDocumentError the document element is neither a UBL Invoice nor a UBL CreditNote
DocumentKindError parseInvoice() was given a credit note, or the other way round

Documents are matched on namespace URIs, never on prefixes: a document that writes n1: for the aggregate namespace and makes Invoice-2 the default parses into exactly the same model as one that writes cac:. A byte order mark is accepted and does not shift the reported positions. No document type declaration is ever expanded: @rgrove/parse-xml discards it and a reference to an entity it defines is a syntax error, so an XXE payload never reaches the file system.

Elements may nest at most 1,000 levels deep, the document element being the first and an empty element counting at its own level. A UBL invoice nests fewer than 20. A deeper document is an XmlSyntaxError pointing at the start tag that goes past the limit: @rgrove/parse-xml, which recurses once per element, stops there before it could overflow the call stack. Hostile input therefore never escapes parse() as a RangeError.

Structural diagnostics

Every diagnostic is an Issue of @einvoice-ts/core with source: 'structure' and carries the model path, the pathString, the xpath and the location (offset, 1-based line and column) of what it is about.

The EN 16931 UBL syntax rules that only the XML can show are reported under their own ids, with the specification's wording and severity, from the tables generated out of the Schematron:

Family What it is about
UBL-CR-001..682 an element or an attribute the Peppol subset does not use
UBL-SR-01..55 an element that appears more often than it may
UBL-DT-08..28 an attribute forbidden wherever it appears

What no rule covers is reported under this library's own codes:

Code Severity When
EINV-XML-UNKNOWN-ELEMENT fatal an element the syntax does not know and no rule names
EINV-XML-UNKNOWN-ATTRIBUTE warning likewise for an attribute; its value is in data
EINV-XML-CARDINALITY fatal too many of an element no UBL-SR rule caps
EINV-XML-ORDER fatal a sibling out of the XSD sequence
EINV-XML-MIXED-CONTENT fatal text inside an aggregate
EINV-XML-EMPTY warning an element with no children and no text (R008)
import { parseInvoice } from '@einvoice-ts/parser';

const { diagnostics } = parseInvoice(xml);

for (const issue of diagnostics) {
  console.error(`${issue.id} at ${issue.xpath} (line ${issue.location?.line}): ${issue.message}`);
}

Leaf text is kept verbatim - no trimming, no collapsing - because the rules apply normalize-space() exactly where the Schematron does. An element that carries nothing becomes the empty string and an EINV-XML-EMPTY warning, which the validator unions with its own model walk for PEPPOL-EN16931-R008.

Also exported

The structural tables generated from the Schematron - UBL_CR_TABLE, UBL_CR_ATTRIBUTE_TABLE, UBL_SR_TABLE, UBL_DT_ATTRIBUTE_TABLE, UBL_RULE_TABLE, UBL_SR_BESPOKE_IDS and UBL_DT_BESPOKE_IDS - so that a rule-coverage report can tell which UBL-* rule is answered where. Everything else (the namespace stack, the locator, the table matchers) is an implementation detail of the walk and is not part of the public surface.

License

MIT. Some generated files reproduce specification text from OpenPeppol, CEN (EUPL-1.2) and OASIS; see NOTICE.

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 @einvoice-ts/parser

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

Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret Stealing Malware Via GitHub Actions & npm

PolinRider Returns
Research

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

Frame 2085668439 (1)
Group 1261154229