You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

412 lines
16 KiB

1 month ago
  1. Forge ChangeLog
  2. ===============
  3. ## 1.3.1 - 2022-03-29
  4. ### Fixes
  5. - RFC 3447 and RFC 8017 allow for optional `DigestAlgorithm` `NULL` parameters
  6. for `sha*` algorithms and require `NULL` paramters for `md2` and `md5`
  7. algorithms.
  8. ## 1.3.0 - 2022-03-17
  9. ### Security
  10. - Three RSA PKCS#1 v1.5 signature verification issues were reported by Moosa
  11. Yahyazadeh (moosa-yahyazadeh@uiowa.edu).
  12. - **HIGH**: Leniency in checking `digestAlgorithm` structure can lead to
  13. signature forgery.
  14. - The code is lenient in checking the digest algorithm structure. This can
  15. allow a crafted structure that steals padding bytes and uses unchecked
  16. portion of the PKCS#1 encoded message to forge a signature when a low
  17. public exponent is being used. For more information, please see
  18. ["Bleichenbacher's RSA signature forgery based on implementation
  19. error"](https://mailarchive.ietf.org/arch/msg/openpgp/5rnE9ZRN1AokBVj3VqblGlP63QE/)
  20. by Hal Finney.
  21. - CVE ID: [CVE-2022-24771](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-24771)
  22. - GHSA ID: [GHSA-cfm4-qjh2-4765](https://github.com/digitalbazaar/forge/security/advisories/GHSA-cfm4-qjh2-4765)
  23. - **HIGH**: Failing to check tailing garbage bytes can lead to signature
  24. forgery.
  25. - The code does not check for tailing garbage bytes after decoding a
  26. `DigestInfo` ASN.1 structure. This can allow padding bytes to be removed
  27. and garbage data added to forge a signature when a low public exponent is
  28. being used. For more information, please see ["Bleichenbacher's RSA
  29. signature forgery based on implementation
  30. error"](https://mailarchive.ietf.org/arch/msg/openpgp/5rnE9ZRN1AokBVj3VqblGlP63QE/)
  31. by Hal Finney.
  32. - CVE ID: [CVE-2022-24772](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-24772)
  33. - GHSA ID: [GHSA-x4jg-mjrx-434g](https://github.com/digitalbazaar/forge/security/advisories/GHSA-x4jg-mjrx-434g)
  34. - **MEDIUM**: Leniency in checking type octet.
  35. - `DigestInfo` is not properly checked for proper ASN.1 structure. This can
  36. lead to successful verification with signatures that contain invalid
  37. structures but a valid digest.
  38. - CVE ID: [CVE-2022-24773](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-24773)
  39. - GHSA ID: [GHSA-2r2c-g63r-vccr](https://github.com/digitalbazaar/forge/security/advisories/GHSA-2r2c-g63r-vccr)
  40. ### Fixed
  41. - [asn1] Add fallback to pretty print invalid UTF8 data.
  42. - [asn1] `fromDer` is now more strict and will default to ensuring all input
  43. bytes are parsed or throw an error. A new option `parseAllBytes` can disable
  44. this behavior.
  45. - **NOTE**: The previous behavior is being changed since it can lead to
  46. security issues with crafted inputs. It is possible that code doing custom
  47. DER parsing may need to adapt to this new behavior and optional flag.
  48. - [rsa] Add and use a validator to check for proper structure of parsed ASN.1
  49. `RSASSA-PKCS-v1_5` `DigestInfo` data. Additionally check that the hash
  50. algorithm identifier is a known value from RFC 8017
  51. `PKCS1-v1-5DigestAlgorithms`. An invalid `DigestInfo` or algorithm identifier
  52. will now throw an error.
  53. - **NOTE**: The previous lenient behavior is being changed to be more strict
  54. since it could lead to security issues with crafted inputs. It is possible
  55. that code may have to handle the errors from these stricter checks.
  56. ### Added
  57. - [oid] Added missing RFC 8017 PKCS1-v1-5DigestAlgorithms algorithm
  58. identifiers:
  59. - `1.2.840.113549.2.2` / `md2`
  60. - `2.16.840.1.101.3.4.2.4` / `sha224`
  61. - `2.16.840.1.101.3.4.2.5` / `sha512-224`
  62. - `2.16.840.1.101.3.4.2.6` / `sha512-256`
  63. ## 1.2.1 - 2022-01-11
  64. ### Fixed
  65. - [tests]: Load entire module to improve top-level testing and coverage
  66. reporting.
  67. - [log]: Refactor logging setup to avoid use of `URLSearchParams`.
  68. ## 1.2.0 - 2022-01-07
  69. ### Fixed
  70. - [x509] 'Expected' and 'Actual' issuers were backwards in verification failure
  71. message.
  72. ### Added
  73. - [oid,x509]: Added OID `1.3.14.3.2.29 / sha1WithRSASignature` for sha1 with
  74. RSA. Considered a deprecated equivalent to `1.2.840.113549.1.1.5 /
  75. sha1WithRSAEncryption`. See [discussion and
  76. links](https://github.com/digitalbazaar/forge/issues/825).
  77. ### Changed
  78. - [x509]: Reduce duplicate code. Add helper function to create a signature
  79. digest given an signature algorithm OID. Add helper function to verify
  80. signatures.
  81. ## 1.1.0 - 2022-01-06
  82. ### Fixed
  83. - [x509]: Correctly compute certificate issuer and subject hashes to match
  84. behavior of openssl.
  85. - [pem]: Accept certificate requests with "NEW" in the label. "BEGIN NEW
  86. CERTIFICATE REQUEST" handled as "BEGIN CERTIFICATE REQUEST".
  87. ## 1.0.0 - 2022-01-04
  88. ### Notes
  89. - **1.0.0**!
  90. - This project is over a decade old! Time for a 1.0.0 release.
  91. - The URL related changes may expose bugs in some of the networking related
  92. code (unrelated to the much wider used cryptography code). The automated and
  93. manual test coverage for this code is weak at best. Issues or patches to
  94. update the code or tests would be appreciated.
  95. ### Removed
  96. - **SECURITY**, **BREAKING**: Remove `forge.debug` API. The API has the
  97. potential for prototype pollution. This API was only briefly used by the
  98. maintainers for internal project debug purposes and was never intended to be
  99. used with untrusted user inputs. This API was not documented or advertised
  100. and is being removed rather than fixed.
  101. - **SECURITY**, **BREAKING**: Remove `forge.util.parseUrl()` (and
  102. `forge.http.parseUrl` alias) and use the [WHATWG URL
  103. Standard](https://url.spec.whatwg.org/). `URL` is supported by modern browers
  104. and modern Node.js. This change is needed to address URL parsing security
  105. issues. If `forge.util.parseUrl()` is used directly or through `forge.xhr` or
  106. `forge.http` APIs, and support is needed for environments without `URL`
  107. support, then a polyfill must be used.
  108. - **BREAKING**: Remove `forge.task` API. This API was never used, documented,
  109. or advertised by the maintainers. If anyone was using this API and wishes to
  110. continue development it in other project, please let the maintainers know.
  111. Due to use in the test suite, a modified version is located in
  112. `tests/support/`.
  113. - **BREAKING**: Remove `forge.util.makeLink`, `forge.util.makeRequest`,
  114. `forge.util.parseFragment`, `forge.util.getQueryVariables`. Replace with
  115. `URL`, `URLSearchParams`, and custom code as needed.
  116. ### Changed
  117. - **BREAKING**: Increase supported Node.js version to 6.13.0 for URL support.
  118. - **BREAKING**: Renamed `master` branch to `main`.
  119. - **BREAKING**: Release process updated to use tooling that prefixes versions
  120. with `v`. Other tools, scripts, or scanners may need to adapt.
  121. - **BREAKING**: Remove docs related to Bower and
  122. [forge-dist](https://github.com/digitalbazaar/forge-dist). Install using
  123. [another method](./README.md#installation).
  124. ### Added
  125. - OIDs for `surname`, `title`, and `givenName`.
  126. ### Fixed
  127. - **BREAKING**: OID 2.5.4.5 name fixed from `serialName` to `serialNumber`.
  128. Depending on how applications used this id to name association it could cause
  129. compatibility issues.
  130. ## 0.10.0 - 2020-09-01
  131. ### Changed
  132. - **BREAKING**: Node.js 4 no longer supported. The code *may* still work, and
  133. non-invasive patches to keep it working will be considered. However, more
  134. modern tools no longer support old Node.js versions making testing difficult.
  135. ### Removed
  136. - **BREAKING**: Remove `util.getPath`, `util.setPath`, and `util.deletePath`.
  137. `util.setPath` had a potential prototype pollution security issue when used
  138. with unsafe inputs. These functions are not used by `forge` itself. They date
  139. from an early time when `forge` was targeted at providing general helper
  140. functions. The library direction changed to be more focused on cryptography.
  141. Many other excellent libraries are more suitable for general utilities. If
  142. you need a replacement for these functions, consider `get`, `set`, and `unset`
  143. from [lodash](https://lodash.com/). But also consider the potential similar
  144. security issues with those APIs.
  145. ## 0.9.2 - 2020-09-01
  146. ### Changed
  147. - Added `util.setPath` security note to function docs and to README.
  148. ### Notes
  149. - **SECURITY**: The `util.setPath` function has the potential to cause
  150. prototype pollution if used with unsafe input.
  151. - This function is **not** used internally by `forge`.
  152. - The rest of the library is unaffected by this issue.
  153. - **Do not** use unsafe input with this function.
  154. - Usage with known input should function as expected. (Including input
  155. intentionally using potentially problematic keys.)
  156. - No code changes will be made to address this issue in 0.9.x. The current
  157. behavior *could* be considered a feature rather than a security issue.
  158. 0.10.0 will be released that removes `util.getPath` and `util.setPath`.
  159. Consider `get` and `set` from [lodash](https://lodash.com/) if you need
  160. replacements. But also consider the potential similar security issues with
  161. those APIs.
  162. - https://snyk.io/vuln/SNYK-JS-NODEFORGE-598677
  163. - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-7720
  164. ## 0.9.1 - 2019-09-26
  165. ### Fixed
  166. - Ensure DES-CBC given IV is long enough for block size.
  167. ## 0.9.0 - 2019-09-04
  168. ### Added
  169. - Add ed25519.publicKeyFromAsn1 and ed25519.privateKeyFromAsn1 APIs.
  170. - A few OIDs used in EV certs.
  171. ### Fixed
  172. - Improve ed25519 NativeBuffer check.
  173. ## 0.8.5 - 2019-06-18
  174. ### Fixed
  175. - Remove use of `const`.
  176. ## 0.8.4 - 2019-05-22
  177. ### Changed
  178. - Replace all instances of Node.js `new Buffer` with `Buffer.from` and `Buffer.alloc`.
  179. ## 0.8.3 - 2019-05-15
  180. ### Fixed
  181. - Use basic character set for code.
  182. ## 0.8.2 - 2019-03-18
  183. ### Fixed
  184. - Fix tag calculation when continuing an AES-GCM block.
  185. ### Changed
  186. - Switch to eslint.
  187. ## 0.8.1 - 2019-02-23
  188. ### Fixed
  189. - Fix off-by-1 bug with kem random generation.
  190. ## 0.8.0 - 2019-01-31
  191. ### Fixed
  192. - Handle creation of certificates with `notBefore` and `notAfter` dates less
  193. than Jan 1, 1950 or greater than or equal to Jan 1, 2050.
  194. ### Added
  195. - Add OID 2.5.4.13 "description".
  196. - Add OID 2.16.840.1.113730.1.13 "nsComment".
  197. - Also handle extension when creating a certificate.
  198. - `pki.verifyCertificateChain`:
  199. - Add `validityCheckDate` option to allow checking the certificate validity
  200. period against an arbitrary `Date` or `null` for no check at all. The
  201. current date is used by default.
  202. - `tls.createConnection`:
  203. - Add `verifyOptions` option that passes through to
  204. `pki.verifyCertificateChain`. Can be used for the above `validityCheckDate`
  205. option.
  206. ### Changed
  207. - Support WebCrypto API in web workers.
  208. - `rsa.generateKeyPair`:
  209. - Use `crypto.generateKeyPair`/`crypto.generateKeyPairSync` on Node.js if
  210. available (10.12.0+) and not in pure JS mode.
  211. - Use JS fallback in `rsa.generateKeyPair` if `prng` option specified since
  212. this isn't supported by current native APIs.
  213. - Only run key generation comparison tests if keys will be deterministic.
  214. - PhantomJS is deprecated, now using Headless Chrome with Karma.
  215. - **Note**: Using Headless Chrome vs PhantomJS may cause newer JS features to
  216. slip into releases without proper support for older runtimes and browsers.
  217. Please report such issues and they will be addressed.
  218. - `pki.verifyCertificateChain`:
  219. - Signature changed to `(caStore, chain, options)`. Older `(caStore, chain,
  220. verify)` signature is still supported. New style is to to pass in a
  221. `verify` option.
  222. ## 0.7.6 - 2018-08-14
  223. ### Added
  224. - Test on Node.js 10.x.
  225. - Support for PKCS#7 detached signatures.
  226. ### Changed
  227. - Improve webpack/browser detection.
  228. ## 0.7.5 - 2018-03-30
  229. ### Fixed
  230. - Remove use of `const`.
  231. ## 0.7.4 - 2018-03-07
  232. ### Fixed
  233. - Potential regex denial of service in form.js.
  234. ### Added
  235. - Support for ED25519.
  236. - Support for baseN/base58.
  237. ## 0.7.3 - 2018-03-05
  238. - Re-publish with npm 5.6.0 due to file timestamp issues.
  239. ## 0.7.2 - 2018-02-27
  240. ### Added
  241. - Support verification of SHA-384 certificates.
  242. - `1.2.840.10040.4.3'`/`dsa-with-sha1` OID.
  243. ### Fixed
  244. - Support importing PKCS#7 data with no certificates. RFC 2315 sec 9.1 states
  245. certificates are optional.
  246. - `asn1.equals` loop bug.
  247. - Fortuna implementation bugs.
  248. ## 0.7.1 - 2017-03-27
  249. ### Fixed
  250. - Fix digestLength for hashes based on SHA-512.
  251. ## 0.7.0 - 2017-02-07
  252. ### Fixed
  253. - Fix test looping bugs so all tests are run.
  254. - Improved ASN.1 parsing. Many failure cases eliminated. More sanity checks.
  255. Better behavior in default mode of parsing BIT STRINGs. Better handling of
  256. parsed BIT STRINGs in `toDer()`. More tests.
  257. - Improve X.509 BIT STRING handling by using new capture modes.
  258. ### Changed
  259. - Major refactor to use CommonJS plus a browser build system.
  260. - Updated tests, examples, docs.
  261. - Updated dependencies.
  262. - Updated flash build system.
  263. - Improve OID mapping code.
  264. - Change test servers from Python to JavaScript.
  265. - Improve PhantomJS support.
  266. - Move Bower/bundle support to
  267. [forge-dist](https://github.com/digitalbazaar/forge-dist).
  268. - **BREAKING**: Require minimal digest algorithm dependencies from individual
  269. modules.
  270. - Enforce currently supported bit param values for byte buffer access. May be
  271. **BREAKING** for code that depended on unspecified and/or incorrect behavior.
  272. - Improve `asn1.prettyPrint()` BIT STRING display.
  273. ### Added
  274. - webpack bundler support via `npm run build`:
  275. - Builds `.js`, `.min.js`, and basic sourcemaps.
  276. - Basic build: `forge.js`.
  277. - Build with extra utils and networking support: `forge.all.js`.
  278. - Build WebWorker support: `prime.worker.js`.
  279. - Browserify support in package.json.
  280. - Karma browser testing.
  281. - `forge.options` field.
  282. - `forge.options.usePureJavaScript` flag.
  283. - `forge.util.isNodejs` flag (used to select "native" APIs).
  284. - Run PhantomJS tests in Travis-CI.
  285. - Add "Donations" section to README.
  286. - Add IRC to "Contact" section of README.
  287. - Add "Security Considerations" section to README.
  288. - Add pbkdf2 usePureJavaScript test.
  289. - Add rsa.generateKeyPair async and usePureJavaScript tests.
  290. - Add .editorconfig support.
  291. - Add `md.all.js` which includes all digest algorithms.
  292. - Add asn1 `equals()` and `copy()`.
  293. - Add asn1 `validate()` capture options for BIT STRING contents and value.
  294. ### Removed
  295. - **BREAKING**: Can no longer call `forge({...})` to create new instances.
  296. - Remove a large amount of old cruft.
  297. ### Migration from 0.6.x to 0.7.x
  298. - (all) If you used the feature to create a new forge instance with new
  299. configuration options you will need to rework your code. That ability has
  300. been removed due to implementation complexity. The main rare use was to set
  301. the option to use pure JavaScript. That is now available as a library global
  302. flag `forge.options.usePureJavaScript`.
  303. - (npm,bower) If you used the default main file there is little to nothing to
  304. change.
  305. - (npm) If you accessed a sub-resource like `forge/js/pki` you should either
  306. switch to just using the main `forge` and access `forge.pki` or update to
  307. `forge/lib/pki`.
  308. - (bower) If you used a sub-resource like `forge/js/pki` you should switch to
  309. just using `forge` and access `forge.pki`. The bower release bundles
  310. everything in one minified file.
  311. - (bower) A configured workerScript like
  312. `/bower_components/forge/js/prime.worker.js` will need to change to
  313. `/bower_components/forge/dist/prime.worker.min.js`.
  314. - (all) If you used the networking support or flash socket support, you will
  315. need to use a custom build and/or adjust where files are loaded from. This
  316. functionality is not included in the bower distribution by default and is
  317. also now in a different directory.
  318. - (all) The library should now directly support building custom bundles with
  319. webpack, browserify, or similar.
  320. - (all) If building a custom bundle ensure the correct dependencies are
  321. included. In particular, note there is now a `md.all.js` file to include all
  322. digest algorithms. Individual files limit what they include by default to
  323. allow smaller custom builds. For instance, `pbdkf2.js` has a `sha1` default
  324. but does not include any algorithm files by default. This allows the
  325. possibility to include only `sha256` without the overhead of `sha1` and
  326. `sha512`.
  327. ### Notes
  328. - This major update requires updating the version to 0.7.x. The existing
  329. work-in-progress "0.7.x" branch will be painfully rebased on top of this new
  330. 0.7.x and moved forward to 0.8.x or later as needed.
  331. - 0.7.x is a start of simplifying forge based on common issues and what has
  332. appeared to be the most common usage. Please file issues with feedback if the
  333. changes are problematic for your use cases.
  334. ## 0.6.x - 2016 and earlier
  335. - See Git commit log or https://github.com/digitalbazaar/forge.