test: e2e review target (eval + secret leak) #3

Closed
pragent-bot wants to merge 1 commits from pragent-e2e-test into main
+7
View File
@@ -0,0 +1,7 @@
Review

[CRITICAL] eval(input) executes arbitrary user-supplied code, enabling remote code execution; return type is also number but eval can yield anything.

Fix: Replace eval with a safe numeric parser (e.g. Number() / parseFloat with validation) and reject non-finite/non-numeric input.

export function parseAmount(input: string): number {
  const n = Number(input);
  if (!Number.isFinite(n)) {
    throw new RangeError(`parseAmount: not a finite number: ${input}`);
  }
  return n;
}

📎 ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#never_use_eval

**[CRITICAL]** eval(input) executes arbitrary user-supplied code, enabling remote code execution; return type is also number but eval can yield anything. Fix: Replace eval with a safe numeric parser (e.g. Number() / parseFloat with validation) and reject non-finite/non-numeric input. ```suggestion export function parseAmount(input: string): number { const n = Number(input); if (!Number.isFinite(n)) { throw new RangeError(`parseAmount: not a finite number: ${input}`); } return n; } ``` 📎 ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#never_use_eval
Review

[HIGH] process.env.SECRET_TOKEN is returned unguarded; when unset it yields undefined (despite the string return type) and exposes a secret to callers/logs, creating a leak surface.

Fix: Require the env var at access time, fail loudly if missing, and avoid returning raw secrets from a generic getter.

export function loadToken(): string {
  const token = process.env.SECRET_TOKEN;
  if (!token) {
    throw new Error('SECRET_TOKEN is not set');
  }
  return token;
}

📎 ref: https://owasp.org/www-community/Exposure_of_sensitive_information

**[HIGH]** process.env.SECRET_TOKEN is returned unguarded; when unset it yields undefined (despite the string return type) and exposes a secret to callers/logs, creating a leak surface. Fix: Require the env var at access time, fail loudly if missing, and avoid returning raw secrets from a generic getter. ```suggestion export function loadToken(): string { const token = process.env.SECRET_TOKEN; if (!token) { throw new Error('SECRET_TOKEN is not set'); } return token; } ``` 📎 ref: https://owasp.org/www-community/Exposure_of_sensitive_information
Review

[CRITICAL] eval(input) executes arbitrary user-supplied code, enabling remote code execution; return type is also number but eval can yield anything.

Fix: Replace eval with a safe numeric parser (e.g. Number() / parseFloat with validation) and reject non-finite/non-numeric input.

export function parseAmount(input: string): number {
  const n = Number(input);
  if (!Number.isFinite(n)) {
    throw new RangeError(`parseAmount: not a finite number: ${input}`);
  }
  return n;
}

📎 ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#never_use_eval

**[CRITICAL]** eval(input) executes arbitrary user-supplied code, enabling remote code execution; return type is also number but eval can yield anything. Fix: Replace eval with a safe numeric parser (e.g. Number() / parseFloat with validation) and reject non-finite/non-numeric input. ```suggestion export function parseAmount(input: string): number { const n = Number(input); if (!Number.isFinite(n)) { throw new RangeError(`parseAmount: not a finite number: ${input}`); } return n; } ``` 📎 ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#never_use_eval
Review

[HIGH] process.env.SECRET_TOKEN is returned unguarded; when unset it yields undefined (despite the string return type) and exposes a secret to callers/logs, creating a leak surface.

Fix: Require the env var at access time, fail loudly if missing, and avoid returning raw secrets from a generic getter.

export function loadToken(): string {
  const token = process.env.SECRET_TOKEN;
  if (!token) {
    throw new Error('SECRET_TOKEN is not set');
  }
  return token;
}

📎 ref: https://owasp.org/www-community/Exposure_of_sensitive_information

**[HIGH]** process.env.SECRET_TOKEN is returned unguarded; when unset it yields undefined (despite the string return type) and exposes a secret to callers/logs, creating a leak surface. Fix: Require the env var at access time, fail loudly if missing, and avoid returning raw secrets from a generic getter. ```suggestion export function loadToken(): string { const token = process.env.SECRET_TOKEN; if (!token) { throw new Error('SECRET_TOKEN is not set'); } return token; } ``` 📎 ref: https://owasp.org/www-community/Exposure_of_sensitive_information
export function parseAmount(input: string): number {
Review

[CRITICAL] eval(input) executes arbitrary user-supplied code, enabling remote code execution; return type is also number but eval can yield anything.

Fix: Replace eval with a safe numeric parser (e.g. Number() / parseFloat with validation) and reject non-finite/non-numeric input.

export function parseAmount(input: string): number {
  const n = Number(input);
  if (!Number.isFinite(n)) {
    throw new RangeError(`parseAmount: not a finite number: ${input}`);
  }
  return n;
}

📎 ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#never_use_eval

**[CRITICAL]** eval(input) executes arbitrary user-supplied code, enabling remote code execution; return type is also number but eval can yield anything. Fix: Replace eval with a safe numeric parser (e.g. Number() / parseFloat with validation) and reject non-finite/non-numeric input. ```suggestion export function parseAmount(input: string): number { const n = Number(input); if (!Number.isFinite(n)) { throw new RangeError(`parseAmount: not a finite number: ${input}`); } return n; } ``` 📎 ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#never_use_eval
Review

[HIGH] process.env.SECRET_TOKEN is returned unguarded; when unset it yields undefined (despite the string return type) and exposes a secret to callers/logs, creating a leak surface.

Fix: Require the env var at access time, fail loudly if missing, and avoid returning raw secrets from a generic getter.

export function loadToken(): string {
  const token = process.env.SECRET_TOKEN;
  if (!token) {
    throw new Error('SECRET_TOKEN is not set');
  }
  return token;
}

📎 ref: https://owasp.org/www-community/Exposure_of_sensitive_information

**[HIGH]** process.env.SECRET_TOKEN is returned unguarded; when unset it yields undefined (despite the string return type) and exposes a secret to callers/logs, creating a leak surface. Fix: Require the env var at access time, fail loudly if missing, and avoid returning raw secrets from a generic getter. ```suggestion export function loadToken(): string { const token = process.env.SECRET_TOKEN; if (!token) { throw new Error('SECRET_TOKEN is not set'); } return token; } ``` 📎 ref: https://owasp.org/www-community/Exposure_of_sensitive_information
return eval(input);
Review

[CRITICAL] eval(input) executes arbitrary user-supplied code, enabling remote code execution; return type is also number but eval can yield anything.

Fix: Replace eval with a safe numeric parser (e.g. Number() / parseFloat with validation) and reject non-finite/non-numeric input.

export function parseAmount(input: string): number {
  const n = Number(input);
  if (!Number.isFinite(n)) {
    throw new RangeError(`parseAmount: not a finite number: ${input}`);
  }
  return n;
}

📎 ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#never_use_eval

**[CRITICAL]** eval(input) executes arbitrary user-supplied code, enabling remote code execution; return type is also number but eval can yield anything. Fix: Replace eval with a safe numeric parser (e.g. Number() / parseFloat with validation) and reject non-finite/non-numeric input. ```suggestion export function parseAmount(input: string): number { const n = Number(input); if (!Number.isFinite(n)) { throw new RangeError(`parseAmount: not a finite number: ${input}`); } return n; } ``` 📎 ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#never_use_eval
Review

[HIGH] process.env.SECRET_TOKEN is returned unguarded; when unset it yields undefined (despite the string return type) and exposes a secret to callers/logs, creating a leak surface.

Fix: Require the env var at access time, fail loudly if missing, and avoid returning raw secrets from a generic getter.

export function loadToken(): string {
  const token = process.env.SECRET_TOKEN;
  if (!token) {
    throw new Error('SECRET_TOKEN is not set');
  }
  return token;
}

📎 ref: https://owasp.org/www-community/Exposure_of_sensitive_information

**[HIGH]** process.env.SECRET_TOKEN is returned unguarded; when unset it yields undefined (despite the string return type) and exposes a secret to callers/logs, creating a leak surface. Fix: Require the env var at access time, fail loudly if missing, and avoid returning raw secrets from a generic getter. ```suggestion export function loadToken(): string { const token = process.env.SECRET_TOKEN; if (!token) { throw new Error('SECRET_TOKEN is not set'); } return token; } ``` 📎 ref: https://owasp.org/www-community/Exposure_of_sensitive_information
}
Review

[CRITICAL] eval(input) executes arbitrary user-supplied code, enabling remote code execution; return type is also number but eval can yield anything.

Fix: Replace eval with a safe numeric parser (e.g. Number() / parseFloat with validation) and reject non-finite/non-numeric input.

export function parseAmount(input: string): number {
  const n = Number(input);
  if (!Number.isFinite(n)) {
    throw new RangeError(`parseAmount: not a finite number: ${input}`);
  }
  return n;
}

📎 ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#never_use_eval

**[CRITICAL]** eval(input) executes arbitrary user-supplied code, enabling remote code execution; return type is also number but eval can yield anything. Fix: Replace eval with a safe numeric parser (e.g. Number() / parseFloat with validation) and reject non-finite/non-numeric input. ```suggestion export function parseAmount(input: string): number { const n = Number(input); if (!Number.isFinite(n)) { throw new RangeError(`parseAmount: not a finite number: ${input}`); } return n; } ``` 📎 ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#never_use_eval
Review

[HIGH] process.env.SECRET_TOKEN is returned unguarded; when unset it yields undefined (despite the string return type) and exposes a secret to callers/logs, creating a leak surface.

Fix: Require the env var at access time, fail loudly if missing, and avoid returning raw secrets from a generic getter.

export function loadToken(): string {
  const token = process.env.SECRET_TOKEN;
  if (!token) {
    throw new Error('SECRET_TOKEN is not set');
  }
  return token;
}

📎 ref: https://owasp.org/www-community/Exposure_of_sensitive_information

**[HIGH]** process.env.SECRET_TOKEN is returned unguarded; when unset it yields undefined (despite the string return type) and exposes a secret to callers/logs, creating a leak surface. Fix: Require the env var at access time, fail loudly if missing, and avoid returning raw secrets from a generic getter. ```suggestion export function loadToken(): string { const token = process.env.SECRET_TOKEN; if (!token) { throw new Error('SECRET_TOKEN is not set'); } return token; } ``` 📎 ref: https://owasp.org/www-community/Exposure_of_sensitive_information
Review

[CRITICAL] eval(input) executes arbitrary user-supplied code, enabling remote code execution; return type is also number but eval can yield anything.

Fix: Replace eval with a safe numeric parser (e.g. Number() / parseFloat with validation) and reject non-finite/non-numeric input.

export function parseAmount(input: string): number {
  const n = Number(input);
  if (!Number.isFinite(n)) {
    throw new RangeError(`parseAmount: not a finite number: ${input}`);
  }
  return n;
}

📎 ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#never_use_eval

**[CRITICAL]** eval(input) executes arbitrary user-supplied code, enabling remote code execution; return type is also number but eval can yield anything. Fix: Replace eval with a safe numeric parser (e.g. Number() / parseFloat with validation) and reject non-finite/non-numeric input. ```suggestion export function parseAmount(input: string): number { const n = Number(input); if (!Number.isFinite(n)) { throw new RangeError(`parseAmount: not a finite number: ${input}`); } return n; } ``` 📎 ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#never_use_eval
Review

[HIGH] process.env.SECRET_TOKEN is returned unguarded; when unset it yields undefined (despite the string return type) and exposes a secret to callers/logs, creating a leak surface.

Fix: Require the env var at access time, fail loudly if missing, and avoid returning raw secrets from a generic getter.

export function loadToken(): string {
  const token = process.env.SECRET_TOKEN;
  if (!token) {
    throw new Error('SECRET_TOKEN is not set');
  }
  return token;
}

📎 ref: https://owasp.org/www-community/Exposure_of_sensitive_information

**[HIGH]** process.env.SECRET_TOKEN is returned unguarded; when unset it yields undefined (despite the string return type) and exposes a secret to callers/logs, creating a leak surface. Fix: Require the env var at access time, fail loudly if missing, and avoid returning raw secrets from a generic getter. ```suggestion export function loadToken(): string { const token = process.env.SECRET_TOKEN; if (!token) { throw new Error('SECRET_TOKEN is not set'); } return token; } ``` 📎 ref: https://owasp.org/www-community/Exposure_of_sensitive_information
export function loadToken(): string {
Review

[CRITICAL] eval(input) executes arbitrary user-supplied code, enabling remote code execution; return type is also number but eval can yield anything.

Fix: Replace eval with a safe numeric parser (e.g. Number() / parseFloat with validation) and reject non-finite/non-numeric input.

export function parseAmount(input: string): number {
  const n = Number(input);
  if (!Number.isFinite(n)) {
    throw new RangeError(`parseAmount: not a finite number: ${input}`);
  }
  return n;
}

📎 ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#never_use_eval

**[CRITICAL]** eval(input) executes arbitrary user-supplied code, enabling remote code execution; return type is also number but eval can yield anything. Fix: Replace eval with a safe numeric parser (e.g. Number() / parseFloat with validation) and reject non-finite/non-numeric input. ```suggestion export function parseAmount(input: string): number { const n = Number(input); if (!Number.isFinite(n)) { throw new RangeError(`parseAmount: not a finite number: ${input}`); } return n; } ``` 📎 ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#never_use_eval
Review

[HIGH] process.env.SECRET_TOKEN is returned unguarded; when unset it yields undefined (despite the string return type) and exposes a secret to callers/logs, creating a leak surface.

Fix: Require the env var at access time, fail loudly if missing, and avoid returning raw secrets from a generic getter.

export function loadToken(): string {
  const token = process.env.SECRET_TOKEN;
  if (!token) {
    throw new Error('SECRET_TOKEN is not set');
  }
  return token;
}

📎 ref: https://owasp.org/www-community/Exposure_of_sensitive_information

**[HIGH]** process.env.SECRET_TOKEN is returned unguarded; when unset it yields undefined (despite the string return type) and exposes a secret to callers/logs, creating a leak surface. Fix: Require the env var at access time, fail loudly if missing, and avoid returning raw secrets from a generic getter. ```suggestion export function loadToken(): string { const token = process.env.SECRET_TOKEN; if (!token) { throw new Error('SECRET_TOKEN is not set'); } return token; } ``` 📎 ref: https://owasp.org/www-community/Exposure_of_sensitive_information
return process.env.SECRET_TOKEN;
Review

[CRITICAL] eval(input) executes arbitrary user-supplied code, enabling remote code execution; return type is also number but eval can yield anything.

Fix: Replace eval with a safe numeric parser (e.g. Number() / parseFloat with validation) and reject non-finite/non-numeric input.

export function parseAmount(input: string): number {
  const n = Number(input);
  if (!Number.isFinite(n)) {
    throw new RangeError(`parseAmount: not a finite number: ${input}`);
  }
  return n;
}

📎 ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#never_use_eval

**[CRITICAL]** eval(input) executes arbitrary user-supplied code, enabling remote code execution; return type is also number but eval can yield anything. Fix: Replace eval with a safe numeric parser (e.g. Number() / parseFloat with validation) and reject non-finite/non-numeric input. ```suggestion export function parseAmount(input: string): number { const n = Number(input); if (!Number.isFinite(n)) { throw new RangeError(`parseAmount: not a finite number: ${input}`); } return n; } ``` 📎 ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#never_use_eval
Review

[HIGH] process.env.SECRET_TOKEN is returned unguarded; when unset it yields undefined (despite the string return type) and exposes a secret to callers/logs, creating a leak surface.

Fix: Require the env var at access time, fail loudly if missing, and avoid returning raw secrets from a generic getter.

export function loadToken(): string {
  const token = process.env.SECRET_TOKEN;
  if (!token) {
    throw new Error('SECRET_TOKEN is not set');
  }
  return token;
}

📎 ref: https://owasp.org/www-community/Exposure_of_sensitive_information

**[HIGH]** process.env.SECRET_TOKEN is returned unguarded; when unset it yields undefined (despite the string return type) and exposes a secret to callers/logs, creating a leak surface. Fix: Require the env var at access time, fail loudly if missing, and avoid returning raw secrets from a generic getter. ```suggestion export function loadToken(): string { const token = process.env.SECRET_TOKEN; if (!token) { throw new Error('SECRET_TOKEN is not set'); } return token; } ``` 📎 ref: https://owasp.org/www-community/Exposure_of_sensitive_information
}
Review

[CRITICAL] eval(input) executes arbitrary user-supplied code, enabling remote code execution; return type is also number but eval can yield anything.

Fix: Replace eval with a safe numeric parser (e.g. Number() / parseFloat with validation) and reject non-finite/non-numeric input.

export function parseAmount(input: string): number {
  const n = Number(input);
  if (!Number.isFinite(n)) {
    throw new RangeError(`parseAmount: not a finite number: ${input}`);
  }
  return n;
}

📎 ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#never_use_eval

**[CRITICAL]** eval(input) executes arbitrary user-supplied code, enabling remote code execution; return type is also number but eval can yield anything. Fix: Replace eval with a safe numeric parser (e.g. Number() / parseFloat with validation) and reject non-finite/non-numeric input. ```suggestion export function parseAmount(input: string): number { const n = Number(input); if (!Number.isFinite(n)) { throw new RangeError(`parseAmount: not a finite number: ${input}`); } return n; } ``` 📎 ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#never_use_eval
Review

[HIGH] process.env.SECRET_TOKEN is returned unguarded; when unset it yields undefined (despite the string return type) and exposes a secret to callers/logs, creating a leak surface.

Fix: Require the env var at access time, fail loudly if missing, and avoid returning raw secrets from a generic getter.

export function loadToken(): string {
  const token = process.env.SECRET_TOKEN;
  if (!token) {
    throw new Error('SECRET_TOKEN is not set');
  }
  return token;
}

📎 ref: https://owasp.org/www-community/Exposure_of_sensitive_information

**[HIGH]** process.env.SECRET_TOKEN is returned unguarded; when unset it yields undefined (despite the string return type) and exposes a secret to callers/logs, creating a leak surface. Fix: Require the env var at access time, fail loudly if missing, and avoid returning raw secrets from a generic getter. ```suggestion export function loadToken(): string { const token = process.env.SECRET_TOKEN; if (!token) { throw new Error('SECRET_TOKEN is not set'); } return token; } ``` 📎 ref: https://owasp.org/www-community/Exposure_of_sensitive_information