gchq/CyberChef · error · OperationError

${this.name} must be greater than or equal to ${this.min}.

Error message

${this.name} must be greater than or equal to ${this.min}.

What it means

Thrown by Ingredient.validate() when type is 'number', the value is a valid number, but it is below the ingredient's configured min (line 136). min is an optional numeric floor declared in the ingredient config.

Source

Thrown at src/core/Ingredient.mjs:136

            }
            if (Array.isArray(checkVal) && checkVal.length > this.maxLength) {
                throw new OperationError(`${this.name} length cannot exceed ${this.maxLength}.`);
            }
            if (checkVal instanceof Uint8Array && checkVal.length > this.maxLength) {
                throw new OperationError(`${this.name} length cannot exceed ${this.maxLength}.`);
            }
        }

        // 3. number checks
        if (this.type === "number") {
            if (checkVal === null || checkVal === undefined || isNaN(checkVal)) {
                throw new OperationError(`${this.name} must be a number.`);
            }
            if (this.integer && !Number.isInteger(checkVal)) {
                throw new OperationError(`${this.name} must be an integer.`);
            }
            if (typeof this.min === "number" && checkVal < this.min) {
                throw new OperationError(`${this.name} must be greater than or equal to ${this.min}.`);
            }
            if (typeof this.max === "number" && checkVal > this.max) {
                throw new OperationError(`${this.name} must be less than or equal to ${this.max}.`);
            }
        }

        // 4. option checks
        if (this.type === "option") {
            if (Array.isArray(this.defaultValue)) {
                const permittedOptions = this.defaultValue.filter(opt => {
                    if (typeof opt !== "string") return false;
                    return !opt.match(/^\[\/?[a-z0-9 -()^]+\]$/i);
                });
                const valStr = (checkVal !== null && checkVal !== undefined) ? String(checkVal).toLowerCase() : "";
                const matchedOption = permittedOptions.find(opt => opt.toLowerCase() === valStr);
                if (!matchedOption) {
                    throw new OperationError(`${this.name} must be one of the following: ${permittedOptions.join(", ")}.`);
                }

View on GitHub (pinned to 4290ea7539)

Solutions

  1. Raise the value to at least min.
  2. If the floor is wrong, lower min in the ingredient config and re-verify the operation handles it.
  3. Clamp the input with Math.max(min, value) before assigning.

Example fix

// before - min is 128
op.ingValues = [64];

// after
op.ingValues = [128];
Defensive patterns

Strategy: validation

Validate before calling

if (typeof min === 'number' && val < min) throw new Error(`${name} < min ${min}`);

Type guard

function atOrAboveMin(v, min): v is number { return typeof v === 'number' && (min == null || v >= min); }

Try / catch

try { op.ingValues = [val]; } catch (e) { if (/greater than or equal to/.test(e.message)) { val = min; } }

Prevention

When it happens

Trigger: A numeric ingredient with min:N receives a value strictly less than N; e.g. a key-size ingredient with min:128 gets 64.

Common situations: User enters a too-small value for rounds/length/offset; a recipe built for a weaker config than the operation now enforces; slider or input clamping missing on the UI side.

Related errors


AI-assisted analysis of gchq/CyberChef@4290ea7539 (2026-08-13). Data as JSON: /api/errors/715de1dd22bf1dfb. Report an issue: GitHub.