mailparser 3.9.1 → 3.9.3

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.
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "3.9.1"
2
+ ".": "3.9.3"
3
3
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.9.3](https://github.com/nodemailer/mailparser/compare/v3.9.2...v3.9.3) (2026-01-28)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * escape URLs and link text in textToHtml to prevent XSS ([921a67d](https://github.com/nodemailer/mailparser/commit/921a67df4cfb38f0b411037d7b26fbd4d5411b08)), closes [#412](https://github.com/nodemailer/mailparser/issues/412)
9
+
10
+ ## [3.9.2](https://github.com/nodemailer/mailparser/compare/v3.9.1...v3.9.2) (2026-01-28)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * Bumpe deps ([508bcf7](https://github.com/nodemailer/mailparser/commit/508bcf75eb36cfd45600d73eacd7ad1e50fc7466))
16
+
3
17
  ## [3.9.1](https://github.com/nodemailer/mailparser/compare/v3.9.0...v3.9.1) (2025-12-11)
4
18
 
5
19
 
package/README.md CHANGED
@@ -2,11 +2,10 @@
2
2
 
3
3
  ![Nodemailer](https://raw.githubusercontent.com/nodemailer/nodemailer/master/assets/nm_logo_200x136.png)
4
4
 
5
- Advanced email parser for Node.js. Everything is handled as a stream which should make it able to parse even very large messages (100MB+) with relatively low overhead.
6
-
7
- ## Looking for a front-end solution?
5
+ > [!IMPORTANT]
6
+ > This module is in maintenance mode. It will continue to receive security updates and critical bug fixes, but no new features or feature changes will be added. For new projects, please consider using [PostalMime](https://github.com/postalsys/postal-mime), which works in both Node.js and browser environments.
8
7
 
9
- _mailparser_ is Node.js only library, so you can't use it reliably in the front-end or bundle with WebPack. If you do need a solution to parse emails in the front-end then use [PostalMime](https://www.npmjs.com/package/postal-mime).
8
+ Advanced email parser for Node.js. Everything is handled as a stream which should make it able to parse even very large messages (100MB+) with relatively low overhead.
10
9
 
11
10
  ## Installation
12
11
 
@@ -1129,7 +1129,11 @@ class MailParser extends Transform {
1129
1129
  result.push(textPart);
1130
1130
  }
1131
1131
 
1132
- result.push(`<a href="${link.url}">${link.text}</a>`);
1132
+ // Escape quotes in URL to prevent XSS
1133
+ let safeUrl = link.url.replace(/"/g, '&quot;');
1134
+ // Escape HTML entities in link text
1135
+ let safeText = he.encode(link.text, { useNamedReferences: true });
1136
+ result.push(`<a href="${safeUrl}">${safeText}</a>`);
1133
1137
 
1134
1138
  last = link.lastIndex;
1135
1139
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mailparser",
3
- "version": "3.9.1",
3
+ "version": "3.9.3",
4
4
  "description": "Parse e-mails",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -21,19 +21,19 @@
21
21
  "encoding-japanese": "2.2.0",
22
22
  "he": "1.2.0",
23
23
  "html-to-text": "9.0.5",
24
- "iconv-lite": "0.7.0",
24
+ "iconv-lite": "0.7.2",
25
25
  "libmime": "5.3.7",
26
26
  "linkify-it": "5.0.0",
27
27
  "@zone-eu/mailsplit": "5.4.8",
28
- "nodemailer": "7.0.11",
28
+ "nodemailer": "7.0.13",
29
29
  "punycode.js": "2.3.1",
30
30
  "tlds": "1.261.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@eslint/eslintrc": "3.3.3",
34
- "@eslint/js": "9.39.1",
34
+ "@eslint/js": "9.39.2",
35
35
  "ajv": "8.17.1",
36
- "eslint": "9.39.1",
36
+ "eslint": "9.39.2",
37
37
  "eslint-config-nodemailer": "1.2.0",
38
38
  "eslint-config-prettier": "10.1.8",
39
39
  "grunt": "1.6.1",
@@ -41,7 +41,7 @@
41
41
  "grunt-contrib-nodeunit": "5.0.0",
42
42
  "grunt-eslint": "26.0.0",
43
43
  "iconv": "3.0.1",
44
- "prettier": "3.7.4",
44
+ "prettier": "3.8.1",
45
45
  "random-message": "1.1.0"
46
46
  },
47
47
  "repository": {