Summary
TaxHacker contains an insecure JWT secret-handling condition in its configuration parsing logic, where manipulation of the BETTER_AUTH_SECRET value can result in hard-coded or predictable credentials.
Because the affected configuration path may be reached through a remotely accessible application, an attacker who can influence the relevant input could potentially compromise authentication protections.
Affected context
The vulnerability occurs in the JWT Secret Handler within lib/config.ts, specifically during processing by envSchema.parse. It affects TaxHacker deployments using the vulnerable configuration behavior, including releases up to 0.8.2. Risk depends on whether an external party can influence the BETTER_AUTH_SECRET value or reach a configuration path that accepts attacker-controlled input.
Exploit preconditions
- Attack surface: A remotely accessible TaxHacker application or configuration-processing path
- Required access: Ability to influence the
BETTER_AUTH_SECRETinput, directly or through an exposed configuration mechanism - Trigger point: Environment-schema parsing during application initialization or authentication setup
- Why exploitation is possible: The secret-handling logic may accept or derive a fixed, predictable, or attacker-influenced credential value instead of requiring a securely managed secret
Why this happens
The underlying issue is insecure credential management in the JWT configuration path. A secret value is not sufficiently protected from hard-coded, predictable, or externally controlled assignment during environment parsing.
This behavior maps primarily to CWE-259: Use of Hard-coded Password, with CWE-798: Use of Hard-coded Credentials also relevant when authentication material is embedded in application logic or configuration defaults. Such patterns weaken the trust boundary around JWT signing secrets and can make authentication tokens easier to forge or validate improperly.
Potential impact
- An attacker may forge or tamper with JWT-based authentication tokens
- Unauthorized users could gain access to protected application functionality
- Account impersonation or privilege escalation could occur
- Sensitive application data may be exposed or modified
- Downstream services trusting the affected tokens could also be impacted
General mitigation guidance
Mitigation generally focuses on ensuring that JWT secrets are generated securely, supplied through protected secret-management facilities, and never embedded as fixed application values.
Common defensive patterns include:
- Rejecting missing, default, predictable, or attacker-controlled secret values
- Keeping authentication secrets outside source code and ordinary user-controlled configuration
- Applying strict validation for secret presence, length, entropy, and provenance
- Separating configuration parsing from authentication initialization and enforcing secure defaults
- Limiting process, service-account, and administrative privileges associated with the application
- Rotating potentially exposed signing secrets and invalidating tokens issued under compromised credentials
How teams detect issues like this
Organizations can identify similar weaknesses through:
- Static analysis searches for embedded passwords, JWT secrets, signing keys, and credential-like constants
- Code review checks for fallback secrets, default authentication keys, and environment values accepted without security validation
- Tests that verify startup fails when secrets are absent, weak, predictable, or externally controlled
- Secret-scanning and repository policy enforcement across source code, configuration, build artifacts, and deployment manifests
- Runtime monitoring for unusual token issuance, authentication failures, privilege changes, or access from unexpected locations
Automated security review tools may help identify hard-coded credential patterns, but findings should be validated against the application's configuration and deployment model.

