/

CVE-2026-86673

Severity:

HIGH RISK

(7.3)

Hard-Coded Credentials (CWE-259) in ningzichun Database

CVE-2026-86673

Deferred

Vulnerability type

Category:

Hard-Coded Credentials

CWE:

CWE-259, CWE-798

Impact:

Unauthorized Database Access

Severity:

HIGH RISK

(7.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

The ningzichun Student Management System contains hard-coded database credentials in the database connection logic within config/database.php. If an attacker can obtain the embedded credentials and reach the associated database service, they may gain unauthorized access to database resources.

Affected context

The issue occurs in deployments of the ningzichun Student Management System that use the affected database connection implementation and retain credentials directly in application source or configuration code. Risk depends on whether the application files, exposed artifacts, or database service are accessible to an attacker and whether the embedded account has broad privileges.

Exploit preconditions

  • Attack surface: The application's database connection configuration and any exposed application artifacts
  • Required access: Access sufficient to inspect the relevant source, deployed files, backups, or other locations containing the embedded credentials
  • Trigger point: Use of the discovered credentials against the configured database service
  • Why exploitation is possible: Credentials stored in application code can be recovered and reused, particularly when the database is reachable and the account is over-privileged

Why this happens

The underlying issue is storing authentication material directly in application code or static configuration rather than retrieving it from a protected secret-management boundary.

This maps primarily to CWE-259: Use of Hard-coded Password, with CWE-798: Use of Hard-coded Credentials also applicable. Hard-coded values are difficult to rotate safely, may be exposed through source repositories or deployment artifacts, and can remain valid across multiple environments.

Potential impact

  • An attacker may authenticate to the associated database
  • Sensitive student or administrative data could be disclosed
  • Database records could be modified or deleted
  • Application integrity could be affected through unauthorized database changes
  • Reused credentials could enable access to other systems

General mitigation guidance

Mitigation generally focuses on removing secrets from source code and reducing the trust placed in static credentials.

Common defensive patterns include:

  • Retrieve database credentials from a dedicated secret-management system or protected runtime mechanism
  • Rotate any credentials that may have been exposed
  • Use separate credentials for each environment and service
  • Assign database accounts only the permissions required by the application
  • Restrict database network access to approved application identities and locations
  • Prevent secrets from entering source repositories, build artifacts, logs, and backups
  • Prefer short-lived or automatically rotated credentials where supported

How teams detect issues like this

Organizations can identify similar weaknesses through:

  • Static analysis searches for password, username, token, or connection-string literals in source files
  • Secret-scanning policies applied to repositories, commits, images, and deployment artifacts
  • Code review checks for direct credential arguments in database connection functions such as mysqli_connect
  • Runtime configuration reviews that verify secrets are injected through protected mechanisms
  • Database monitoring for unexpected client identities, locations, or privilege usage
  • Automated security review tools that flag hard-coded credentials and excessive database permissions

Sources

SourceLink
github.comgithub.com/ningzichun/student-management-system/issues/15
vuldb.comvuldb.com/cve/CVE-2026-86673
vuldb.comvuldb.com/submit/908932
vuldb.comvuldb.com/vuln/399764
vuldb.comvuldb.com/vuln/399764/cti

Frequently asked

questions

Potentially. Remote exploitation depends on whether an attacker can obtain the embedded credentials and reach the associated database or another service that accepts them.

Not necessarily. An attacker who can recover the credentials from exposed source, files, artifacts, or backups may be able to use them independently of normal application authentication.

Remove credentials from application code, rotate potentially exposed accounts, inject secrets through a protected secret-management mechanism, and limit database privileges.

Enforce secret-scanning and credential-handling policies in development and CI pipelines, review database connection code, and monitor repositories and deployments for newly introduced secrets.

Find out what's already
exploitable in your codebase.