Skip to content

[Security] Biometric type from abstract method not validated — can be spoofed in mocked environments #782

Description

@RUKAYAT-CODER

Overview

mobileAuth.ts accepts a BiometricType return value from an abstract method without runtime validation. In a mocked or test environment, any string can be passed as the biometric type, bypassing the type guard.

Specifications

Features:

  • Add a runtime validation function isValidBiometricType(value: unknown): value is BiometricType
  • Call it before using the biometric type to authenticate

Tasks:

  • Define a VALID_BIOMETRIC_TYPES constant array
  • Implement the type guard
  • Call the guard before biometric operations
  • Write tests for invalid biometric type values

Impacted Files:

  • src/services/mobileAuth.ts

Acceptance Criteria

  • Invalid biometric types are rejected with a clear error
  • No runtime spoofing possible even in test environments
  • Type guard has 100% test coverage

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programsecuritySecurity vulnerability or concern

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions