Language: JavaScript
Label: safe
CWE: CWE-331 \u2014 Insufficient Entropy
The product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others.

Code:
    AesCbcCryptor.prototype.encryptFileData = function (data) {
        return __awaiter(this, void 0, void 0, function () {
            var key, iv;
            var _a;
            return __generator(this, function (_b) {
                switch (_b.label) {
                    case 0: return [4 /*yield*/, this.getKey()];
                    case 1:
                        key = _b.sent();
                        iv = this.getIv();
                        _a = {};
                        return [4 /*yield*/, crypto.subtle.encrypt({ name: this.algo, iv: iv }, key, data)];
                    case 2: return [2 /*return*/, (_a.data = _b.sent(),
                            _a.metadata = iv,
                            _a)];
                }
            });
        });
    };