@postalsys/email-text-tools 2.4.6 → 2.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/codeql/codeql-config.yml +11 -0
- package/.github/workflows/codeql.yml +47 -0
- package/.github/workflows/release.yaml +3 -3
- package/.github/workflows/test.yaml +12 -3
- package/.ncurc.js +2 -1
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +7 -0
- package/SECURITY.md +81 -0
- package/lib/juice-worker.js +3 -1
- package/lib/mime-html.js +3 -1
- package/package.json +4 -4
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
name: "email-text-tools CodeQL config"
|
|
2
|
+
|
|
3
|
+
# Exclude code that is not part of the published runtime from analysis.
|
|
4
|
+
# These paths generate only false-positive noise:
|
|
5
|
+
# - tests and fixtures intentionally feed malformed/hostile input
|
|
6
|
+
# - benchmarks and examples are developer-only helper scripts
|
|
7
|
+
paths-ignore:
|
|
8
|
+
- test
|
|
9
|
+
- '**/test/**'
|
|
10
|
+
- benchmark
|
|
11
|
+
- examples
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: "CodeQL Advanced"
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: ["main"]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: ["main"]
|
|
8
|
+
schedule:
|
|
9
|
+
- cron: "40 17 * * 6"
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
analyze:
|
|
13
|
+
name: Analyze (${{ matrix.language }})
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
permissions:
|
|
16
|
+
# required for all workflows
|
|
17
|
+
security-events: write
|
|
18
|
+
# required to fetch internal or private CodeQL packs
|
|
19
|
+
packages: read
|
|
20
|
+
# only required for workflows in private repositories
|
|
21
|
+
actions: read
|
|
22
|
+
contents: read
|
|
23
|
+
|
|
24
|
+
strategy:
|
|
25
|
+
fail-fast: false
|
|
26
|
+
matrix:
|
|
27
|
+
include:
|
|
28
|
+
- language: actions
|
|
29
|
+
build-mode: none
|
|
30
|
+
- language: javascript-typescript
|
|
31
|
+
build-mode: none
|
|
32
|
+
|
|
33
|
+
steps:
|
|
34
|
+
- name: Checkout repository
|
|
35
|
+
uses: actions/checkout@v6
|
|
36
|
+
|
|
37
|
+
- name: Initialize CodeQL
|
|
38
|
+
uses: github/codeql-action/init@v4
|
|
39
|
+
with:
|
|
40
|
+
languages: ${{ matrix.language }}
|
|
41
|
+
build-mode: ${{ matrix.build-mode }}
|
|
42
|
+
config-file: ./.github/codeql/codeql-config.yml
|
|
43
|
+
|
|
44
|
+
- name: Perform CodeQL Analysis
|
|
45
|
+
uses: github/codeql-action/analyze@v4
|
|
46
|
+
with:
|
|
47
|
+
category: "/language:${{ matrix.language }}"
|
|
@@ -16,7 +16,7 @@ jobs:
|
|
|
16
16
|
outputs:
|
|
17
17
|
release_created: ${{ steps.release.outputs.release_created }}
|
|
18
18
|
steps:
|
|
19
|
-
- uses: googleapis/release-please-action@
|
|
19
|
+
- uses: googleapis/release-please-action@v5
|
|
20
20
|
id: release
|
|
21
21
|
|
|
22
22
|
publish:
|
|
@@ -28,8 +28,8 @@ jobs:
|
|
|
28
28
|
contents: read
|
|
29
29
|
id-token: write
|
|
30
30
|
steps:
|
|
31
|
-
- uses: actions/checkout@
|
|
32
|
-
- uses: actions/setup-node@
|
|
31
|
+
- uses: actions/checkout@v6
|
|
32
|
+
- uses: actions/setup-node@v6
|
|
33
33
|
with:
|
|
34
34
|
node-version: 24
|
|
35
35
|
registry-url: 'https://registry.npmjs.org'
|
|
@@ -4,19 +4,28 @@ on:
|
|
|
4
4
|
push:
|
|
5
5
|
pull_request:
|
|
6
6
|
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
concurrency:
|
|
11
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
12
|
+
cancel-in-progress: true
|
|
13
|
+
|
|
7
14
|
jobs:
|
|
8
15
|
test:
|
|
9
16
|
strategy:
|
|
10
17
|
matrix:
|
|
11
|
-
node: [
|
|
18
|
+
node: [22.x, 24.x]
|
|
12
19
|
os: [ubuntu-latest]
|
|
13
20
|
runs-on: ${{ matrix.os }}
|
|
21
|
+
timeout-minutes: 10
|
|
14
22
|
steps:
|
|
15
|
-
- uses: actions/checkout@
|
|
23
|
+
- uses: actions/checkout@v6
|
|
16
24
|
- name: Use Node.js ${{ matrix.node }}
|
|
17
|
-
uses: actions/setup-node@
|
|
25
|
+
uses: actions/setup-node@v6
|
|
18
26
|
with:
|
|
19
27
|
node-version: ${{ matrix.node }}
|
|
28
|
+
cache: npm
|
|
20
29
|
- run: npm install
|
|
21
30
|
- run: npm run lint
|
|
22
31
|
- run: npm test
|
package/.ncurc.js
CHANGED
|
@@ -3,6 +3,7 @@ module.exports = {
|
|
|
3
3
|
reject: [
|
|
4
4
|
// Block package upgrades that moved to ESM
|
|
5
5
|
'nanoid',
|
|
6
|
-
'jsdom' // parse5 dependency in 27.0.1 is ESM only
|
|
6
|
+
'jsdom', // parse5 dependency in 27.0.1 is ESM only
|
|
7
|
+
'juice' // 12+ is pure ESM (requires Node >=22.12) and breaks pkg builds
|
|
7
8
|
]
|
|
8
9
|
};
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.4.7](https://github.com/postalsys/email-text-tools/compare/v2.4.6...v2.4.7) (2026-06-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* pin juice to 11.x and bump remaining deps ([307a337](https://github.com/postalsys/email-text-tools/commit/307a3379713624a2eee5897ee7a4755232935792))
|
|
9
|
+
|
|
3
10
|
## [2.4.6](https://github.com/postalsys/email-text-tools/compare/v2.4.5...v2.4.6) (2026-05-29)
|
|
4
11
|
|
|
5
12
|
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
`@postalsys/email-text-tools` converts and sanitizes email content for display -
|
|
4
|
+
turning plain text into HTML, HTML into plain text, and sanitizing/CSS-inlining
|
|
5
|
+
arbitrary (and often untrusted) email HTML into markup that is safe to render.
|
|
6
|
+
Because it processes attacker-controlled input and its output is shown to end
|
|
7
|
+
users, we take security reports seriously and aim to respond quickly.
|
|
8
|
+
|
|
9
|
+
## Supported Versions
|
|
10
|
+
|
|
11
|
+
Security fixes are released only against the latest version. We do not backport
|
|
12
|
+
patches to older releases - upgrading to the current release line is the
|
|
13
|
+
supported way to receive security updates.
|
|
14
|
+
|
|
15
|
+
| Version | Supported |
|
|
16
|
+
| ------- | ------------------ |
|
|
17
|
+
| 2.x | :white_check_mark: |
|
|
18
|
+
| < 2.0 | :x: |
|
|
19
|
+
|
|
20
|
+
If you are on an older version, please upgrade. See the release notes at
|
|
21
|
+
<https://github.com/postalsys/email-text-tools/releases> before updating.
|
|
22
|
+
|
|
23
|
+
## Reporting a Vulnerability
|
|
24
|
+
|
|
25
|
+
**Please do not report security vulnerabilities through public GitHub issues,
|
|
26
|
+
pull requests, or discussions.**
|
|
27
|
+
|
|
28
|
+
Report privately through one of the following channels:
|
|
29
|
+
|
|
30
|
+
1. **GitHub Security Advisories (preferred).** Open a private report at
|
|
31
|
+
<https://github.com/postalsys/email-text-tools/security/advisories/new>. This
|
|
32
|
+
keeps the discussion private until a fix is published and lets us credit you.
|
|
33
|
+
2. **Email.** Send details to **andris@postalsys.com**. Encrypt sensitive details
|
|
34
|
+
if possible.
|
|
35
|
+
|
|
36
|
+
When reporting, please include as much of the following as you can:
|
|
37
|
+
|
|
38
|
+
- The affected version(s) and environment (package version, Node.js version, OS).
|
|
39
|
+
- The function involved (`mimeHtml`, `textToHtml`, `htmlToText`, `inlineHtml`,
|
|
40
|
+
`inlineText`).
|
|
41
|
+
- A clear description of the issue and its impact (e.g. XSS / sanitizer bypass,
|
|
42
|
+
denial of service via catastrophic regex backtracking or CSS that hangs
|
|
43
|
+
processing, prototype pollution, content or information disclosure).
|
|
44
|
+
- A minimal proof of concept: the input that triggers it and the unsafe output
|
|
45
|
+
or behavior it produces.
|
|
46
|
+
- Any suggested remediation, if you have one.
|
|
47
|
+
|
|
48
|
+
We are a small team, so there is no guaranteed response time - sometimes reports
|
|
49
|
+
are handled within hours, sometimes they take longer. Accepted issues are fixed
|
|
50
|
+
in a new release and coordinated through a GitHub Security Advisory, and
|
|
51
|
+
reporters who wish to be named are credited.
|
|
52
|
+
|
|
53
|
+
## CVEs
|
|
54
|
+
|
|
55
|
+
We track and disclose vulnerabilities through GitHub Security Advisories. We do
|
|
56
|
+
not request or manage CVE identifiers ourselves. If you need a CVE assigned for a
|
|
57
|
+
reported issue, please request one yourself - for example, through GitHub's own
|
|
58
|
+
CVE request flow on the published advisory, or another CNA.
|
|
59
|
+
|
|
60
|
+
## Scope
|
|
61
|
+
|
|
62
|
+
In scope: the library source in this repository - in particular:
|
|
63
|
+
|
|
64
|
+
- Sanitizer bypasses in `mimeHtml` that let active content (scripts, event
|
|
65
|
+
handler attributes, dangerous URL schemes, or other executable markup) survive
|
|
66
|
+
into the sanitized output.
|
|
67
|
+
- Denial of service in any conversion path - input that causes catastrophic
|
|
68
|
+
regex backtracking or makes CSS inlining hang or exhaust resources.
|
|
69
|
+
- Prototype pollution or similar object-integrity issues reachable through the
|
|
70
|
+
public API.
|
|
71
|
+
|
|
72
|
+
Out of scope:
|
|
73
|
+
|
|
74
|
+
- Vulnerabilities in your own application that consumes this library - for
|
|
75
|
+
example, rendering the output without a Content Security Policy, or trusting
|
|
76
|
+
the output in a non-HTML context.
|
|
77
|
+
- Issues in third-party dependencies that are already publicly known; report
|
|
78
|
+
those upstream (we will still pick up the dependency fix in a release).
|
|
79
|
+
- Missing security hardening without a demonstrated, concrete impact.
|
|
80
|
+
|
|
81
|
+
Thank you for helping keep email-text-tools and its users safe.
|
package/lib/juice-worker.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const { parentPort } = require('worker_threads');
|
|
4
|
-
|
|
4
|
+
// Pinned to juice 11.x: juice 12+ is pure ESM (requires Node >=22.12) and breaks pkg builds.
|
|
5
|
+
// The `.default` fallback keeps this working if juice ever ships a CJS-compatible build again.
|
|
6
|
+
const juice = require('juice').default || require('juice');
|
|
5
7
|
|
|
6
8
|
parentPort.on('message', html => {
|
|
7
9
|
try {
|
package/lib/mime-html.js
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
const createDOMPurify = require('dompurify');
|
|
4
4
|
const { JSDOM } = require('jsdom');
|
|
5
|
-
|
|
5
|
+
// Pinned to juice 11.x: juice 12+ is pure ESM (requires Node >=22.12) and breaks pkg builds.
|
|
6
|
+
// The `.default` fallback keeps this working if juice ever ships a CJS-compatible build again.
|
|
7
|
+
const juice = require('juice').default || require('juice');
|
|
6
8
|
const he = require('he');
|
|
7
9
|
const { Worker } = require('worker_threads');
|
|
8
10
|
const path = require('path');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@postalsys/email-text-tools",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.7",
|
|
4
4
|
"description": "Email text tools",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"homepage": "https://github.com/postalsys/email-text-tools#readme",
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@eslint/js": "10.0.1",
|
|
29
|
-
"eslint": "10.
|
|
29
|
+
"eslint": "10.5.0",
|
|
30
30
|
"eslint-config-prettier": "10.1.8",
|
|
31
|
-
"prettier": "3.8.
|
|
31
|
+
"prettier": "3.8.4"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"dompurify": "3.4.
|
|
34
|
+
"dompurify": "3.4.10",
|
|
35
35
|
"he": "1.2.0",
|
|
36
36
|
"html-to-text": "10.0.0",
|
|
37
37
|
"jsdom": "27.0.0",
|