Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Babel-Loader Fails on FIPS: Digest method not supported #910

Open
BurntCoffee543 opened this issue Jun 30, 2021 · 3 comments
Open

Babel-Loader Fails on FIPS: Digest method not supported #910

BurntCoffee543 opened this issue Jun 30, 2021 · 3 comments

Comments

@BurntCoffee543
Copy link

I'm submitting a bug report

Webpack Version:
5.40.0

Babel Core Version:
7.14.6

Babel Loader Version:
8.2.2

Please tell us about your environment:
RHEL

Current behavior:

Error: Digest method not supported
    at new Hash (internal/crypto/hash.js:46:19)
    at Object.createHash (crypto.js:115:10)
    at filename (/omitted_project_path/node_modules/babel-loader/lib/cache.js:94:23)
    at /omitted_project_path/node_modules/babel-loader/lib/cache.js:120:39
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/omitted_project_path/node_modules/babel-loader/lib/cache.js:3:103)
    at _next (/omitted_project_path/node_modules/babel-loader/lib/cache.js:5:194)
    at /omitted_project_path/node_modules/babel-loader/lib/cache.js:5:364
    at new Promise (<anonymous>)
    at /omitted_project_path/node_modules/babel-loader/lib/cache.js:5:97

Expected/desired behavior:

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem along with a gist/jsbin of your webpack configuration.
    I cannot easily link a StackBlitz or GitHub repo as fips has to be enabled on the Node distribution. The error occurs when doing a build of a Node application on a FIPS-enabled system.
    Webpack Config (used to splice out the md4 hashes in Webpack)
const webpack = require('webpack');
module.exports = {
  output: {
    hashFunction: 'sha256'
  },
  optimization: {
    concatenateModules: false
  },
  plugins: [
    new webpack.ids.HashedModuleIdsPlugin({
      hashFunction: 'sha256'
    })
  ]
};
  • What is the expected behavior?
    The hash changes from Use md4 instead of sha1 for filename hashes #638 and Use MD4 instead of SHA1 for filename hashes #639 use md4 which is not a supported hashing algorithm for FIPS-compliant systems. Although md4 is a faster hashing algorithm, a configuration option should be provided for those building in a FIPS-compliant environment to specify an alternative hash, such as sha-256.

  • What is the motivation / use case for changing the behavior?
    Allowing builds to use a compliant hashing algorithm.

@darmbrust
Copy link
Contributor

#939 fixes this issue.

@kennylmay
Copy link

Would it be possible to get a new release with this fix in it?

@mateBe95
Copy link

mateBe95 commented Dec 21, 2023

Is it possible to get this into backward support for babel 8x? darmbrust

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants