Database & Information Security

Chapter 3
Threats, Vulnerabilities and Database Risk

Diploma in Cybersecurity
Database & Information Security   •   Diploma

Threats, Vulnerabilities and Database Risk

Introduction

Databases are central targets in cybersecurity because they store information that is valuable, reusable and often difficult to replace. Customer records, authentication data, financial transactions, health information, intellectual property and operational records may all be held in database systems. A successful attack can therefore affect confidentiality, integrity and availability simultaneously.

Database security is not limited to installing a firewall or encrypting a disk. Effective protection requires an understanding of what must be protected, who might attack it, how weaknesses can be exploited, how likely exploitation is, and what consequences would follow. This chapter introduces a practical risk-based approach to database security. It examines threat actors, attack surfaces, misconfiguration, malware, insider threats, inference, aggregation and data leakage, then applies these concepts through asset assessments, threat and vulnerability analysis, likelihood and impact evaluation, risk registers and treatment decisions.

A useful distinction is important from the beginning:

  • A threat is a potential cause of harm.
  • A vulnerability is a weakness that a threat can exploit.
  • An attack is an intentional attempt to exploit a vulnerability.
  • Risk is the possibility of loss arising from the interaction of a threat, vulnerability, likelihood and impact.
  • A control is a safeguard intended to prevent, detect, limit or recover from an unwanted event.

Risk assessment is not a one-time technical exercise. Databases change when applications, users, cloud services, suppliers and business processes change. Consequently, database risk management is a continuing governance activity.

Learning Objectives

By the end of this chapter, you should be able to:

  1. Classify common database threat actors and attack motives.
  2. Identify database attack surfaces and explain how weaknesses arise.
  3. Distinguish misconfiguration, malware, insider threats, inference, aggregation and data leakage.
  4. Identify and value database assets.
  5. Assess threats, vulnerabilities, likelihood and impact in a structured way.
  6. Construct a practical database risk register.
  7. Select appropriate risk-treatment decisions and controls.
  8. Explain ethical, legal and governance responsibilities in database risk management.

1. The Database Threat Environment

1.1 Threat actors

A threat actor is an individual, group or organisation capable of causing a security event. Actors differ in skill, resources, access and motivation. The same database may face several actor categories at once.

Threat actorTypical capability or motiveExamples of database risk
CybercriminalsFinancial gain, extortion or resale of dataCredential theft, ransomware, data theft
Nation-state groupsEspionage, influence or strategic disruptionLong-term covert access, intellectual-property theft
HacktivistsPolitical or social objectivesDefacement, disclosure, denial of service
Malicious insidersRevenge, profit or coercionUnauthorised queries, record alteration, disclosure
Negligent insidersError, poor judgment or lack of trainingAccidental exposure, deletion or misdirected exports
Contractors and suppliersLegitimate access that may be abused or compromisedSupply-chain compromise, excessive privileges
Automated attackersScanning and exploitation at scalePassword attacks, exploitation of known weaknesses

Threat actors should not be assessed only by their labels. A trusted employee may have more effective access than an external attacker, while an external criminal group may possess greater technical capability. Assessment should consider capability, opportunity, intent, access and persistence.

1.2 Attack surfaces

The attack surface is the collection of interfaces, services, accounts, pathways and dependencies through which a system can be attacked. Database attack surfaces commonly include:

  • Internet-facing database ports and administration consoles.
  • Web and mobile applications that submit database queries.
  • APIs, microservices and integration platforms.
  • Database management systems, extensions, drivers and plugins.
  • Operating systems, containers, virtual machines and cloud control planes.
  • Backup repositories, replicas, exports and reporting platforms.
  • Privileged accounts, service accounts and shared credentials.
  • Developer, test and analytics environments containing copied production data.
  • Network links to suppliers and managed-service providers.
  • Physical servers, removable media and administrator workstations.

Attack-surface reduction is a major security principle. Services that are not required should be removed or disabled. Required services should be reachable only by authorised systems and users. However, reducing exposure does not eliminate risk: an internal application or privileged account can still provide a powerful attack path.

1.3 Common attack paths

An attack path describes the sequence by which an actor reaches a valuable asset. For example:

  1. An attacker obtains a developer password through phishing.
  2. The password is reused on a cloud administration portal.
  3. The attacker creates a database account with elevated permissions.
  4. Sensitive tables are exported to an external location.
  5. Logs are altered or deleted to conceal the activity.

This example demonstrates why database security must include identity management, cloud administration, application security, monitoring and incident response. A database may be technically patched and still be exposed through a compromised identity.

2. Major Database Threats and Vulnerabilities

2.1 Misconfiguration

Misconfiguration occurs when a system is deployed or operated with insecure settings. It is one of the most common practical causes of database exposure. Examples include:

  • A database listening on a public network interface when private access is sufficient.
  • Default or weak administrative credentials.
  • Excessive permissions granted to applications or users.
  • Disabled encryption for network connections or backups.
  • Debugging interfaces enabled in production.
  • Inadequate logging or logs stored where administrators can erase them.
  • Backups accessible through broadly shared cloud storage.
  • Unpatched database software or unsupported operating systems.
  • Test copies containing real personal information.
  • Missing retention and secure-disposal settings.

Misconfiguration is often caused by speed, complexity, unclear ownership or insecure defaults. It is not necessarily evidence of incompetence; modern platforms contain many interacting settings. Effective practice therefore uses secure configuration baselines, change control, automated configuration checks and periodic review.

2.2 Injection and application-mediated attacks

An application may construct database commands from user input. If input is not safely handled, an attacker may alter the intended command. This is commonly called injection. SQL injection is a familiar example, but similar problems can occur in NoSQL queries, operating-system commands, search expressions and stored procedures.

The primary defensive approach is to use parameterised queries or prepared statements, in which data values are transmitted separately from the query structure. Input validation, least privilege, safe error handling, code review and application testing provide additional protection. Escaping input alone is generally less reliable than parameterisation because escaping rules vary by database engine and context.

2.3 Malware and ransomware

Malware is malicious software designed to perform unauthorised actions. Database-related malware may steal credentials, capture data, encrypt files, delete records, install persistence or use a server to attack other systems. Ransomware may encrypt database files, snapshots and backups, or compromise administrative tools before encryption begins.

Database availability depends on more than the database process. It also depends on storage, operating systems, identity services, network connectivity and backup systems. Resilience therefore requires offline or otherwise protected backups, restoration testing, separation of administrative privileges, monitoring for unusual encryption or deletion activity, and a documented recovery process.

2.4 Insider threats

An insider is a person with legitimate organisational access. Insider risk includes malicious behaviour, negligence, coercion and compromised accounts. A database administrator may read records unrelated to their duties; an analyst may export an entire customer table when only a small report was needed; or an employee may upload sensitive data to an unauthorised cloud tool.

Controls should not assume that insiders are inherently untrustworthy. They should make access appropriate, observable and accountable. Important measures include role-based access control, separation of duties, just-in-time privilege, approval for bulk exports, database activity monitoring, user-behaviour review and prompt removal of access after role changes.

2.5 Inference

Inference occurs when a person derives protected information from information that is individually available. For example, a statistical query may reveal that a small department contains only one employee with a particular medical condition. The database did not directly disclose the record, but a combination of permitted facts allowed the sensitive conclusion to be inferred.

Inference is especially important in statistical, research and data-warehouse environments. Defences may include minimum group sizes, suppression of small results, query auditing, controlled data views, differential privacy techniques where appropriate, and review of whether repeated queries can be combined to defeat restrictions.

2.6 Aggregation

Aggregation is the combination of separate data items to create a more sensitive or revealing collection. A birth date may seem low-risk alone, and an address may seem low-risk alone, but together with an email address and transaction history they may identify a person and expose behavioural information.

Aggregation risk may arise inside an organisation, across databases or through external data sources. Data classification should therefore consider not only individual fields but also combinations, linkage and the purpose of processing. Data minimisation is a central defence: do not collect, copy or retain information without a legitimate need.

2.7 Data leakage and exfiltration

Data leakage is the unauthorised exposure, transmission or disclosure of information. It can be intentional or accidental. Common routes include public cloud storage, email attachments, screenshots, removable media, unsecured APIs, verbose error messages, logs, reports, development datasets and compromised backups.

Exfiltration may be slow and disguised as normal activity. Monitoring should therefore consider unusual query volume, access outside normal working patterns, large exports, new destinations, use of compression or encryption tools, and access to records unrelated to a user’s role. Prevention should be combined with detection because no single control is perfect.

2.8 Vulnerability classes

A vulnerability may be technical, procedural, human or architectural. Examples include:

  • Technical: unpatched software, weak cryptography or insecure permissions.
  • Procedural: no access review, weak supplier assurance or absent backup testing.
  • Human: inadequate training, social-engineering susceptibility or poor handling of exports.
  • Architectural: excessive trust between systems, a single administrative pathway or unsegmented networks.

A vulnerability does not automatically create high risk. Its significance depends on the threat, exposure, existing controls and consequences of exploitation.

3. A Risk-Based Assessment Method

3.1 Asset identification and valuation

An asset is something that has value to an organisation and requires protection. Database assets include data, database services, schemas, credentials, encryption keys, logs, backups, infrastructure and business processes dependent on availability.

Asset valuation should consider at least:

  • Confidentiality: harm from unauthorised disclosure.
  • Integrity: harm from unauthorised or inaccurate alteration.
  • Availability: harm from interruption or destruction.
  • Legal, regulatory and contractual obligations.
  • Financial, operational, safety and reputational consequences.
  • Critical dependencies and recovery requirements.

A customer database may have high confidentiality value, while a transaction database may have especially high integrity and availability value. The same asset can have different values for different business processes.

3.2 Threat assessment

For each asset, identify credible threat events rather than vague statements such as “hacking.” A useful threat statement identifies the actor, action and target. For example: “A compromised employee account exports customer records from the production reporting database.” This statement supports meaningful control selection.

Threat assessment should consider:

  • Who could perform the action?
  • What access or capability is required?
  • What motive or opportunity exists?
  • Is the asset exposed externally, internally or through a supplier?
  • Have similar events occurred in the organisation or sector?
  • Which existing controls reduce the opportunity?

3.3 Vulnerability assessment

A vulnerability assessment identifies weaknesses that could enable the threat event. Evidence may come from configuration reviews, vulnerability scanners, penetration tests, code review, access reviews, audit findings, incident records and interviews.

Assessment should avoid treating scanner findings as risk ratings by themselves. A critical software weakness on an isolated, non-sensitive test server may represent less organisational risk than a moderate access-control weakness on a highly sensitive production database.

3.4 Likelihood and impact

Likelihood expresses how probable a threat event is within a defined period or scenario. Impact expresses the severity if it occurs. Both must be defined consistently.

A simple qualitative scale may use ratings from 1 to 5:

RatingLikelihood interpretationImpact interpretation
1Rare or highly unlikelyNegligible harm
2UnlikelyMinor harm
3PossibleModerate harm
4LikelyMajor harm
5Almost certain or frequentSevere or catastrophic harm

A commonly used screening approach is:

Risk score = Likelihood × Impact

Likelihood and impact are ordinal ratings, not necessarily precise probabilities or monetary values. The multiplication provides a consistent prioritisation aid, not a scientific prediction. If likelihood is rated 4 and impact is rated 5, the screening score is 20 on a 1–25 scale. An organisation must define thresholds, such as low, medium, high and critical, before using the score for decisions.

A more quantitative expected-loss model can be used when reliable data exist:

Expected annual loss = Annual rate of occurrence × Single-loss expectancy

The annual rate of occurrence is the estimated number of events per year, and the single-loss expectancy is the monetary loss from one event. The model assumes that the estimates are meaningful and that multiplying frequency by average loss is appropriate. It can support economic decisions but should not replace legal, ethical or safety considerations. Uncertainty should be documented rather than hidden behind a precise number.

3.5 Inherent and residual risk

Inherent risk is the risk before considering controls. Residual risk is the risk remaining after controls are applied. For example, public exposure, weak authentication and valuable data may create high inherent risk. Network restriction, multi-factor authentication, least privilege, monitoring and tested backups may reduce residual risk, although they rarely eliminate it.

Residual risk should be compared with the organisation’s risk appetite. If it exceeds the acceptable level, further treatment is required or an authorised decision-maker must explicitly accept the risk.

4. The Database Risk Register

A risk register is a controlled record of identified risks and planned responses. A useful register includes:

FieldPurpose
Risk IDProvides a unique reference
Asset and ownerIdentifies what is at risk and who is accountable
Threat eventDescribes what may happen
VulnerabilityStates the weakness enabling the event
Existing controlsRecords current safeguards
Likelihood and impactDocuments assessment reasoning
Inherent riskShows exposure before treatment
Treatment actionSpecifies the response
Responsible ownerAssigns accountability
Due date and statusSupports follow-up
Residual riskRecords remaining exposure
Evidence and review dateSupports assurance and reassessment

A strong entry is specific and actionable. “Database insecure” is too vague. “A reporting service account has read access to all customer tables, although it requires only three tables; compromise could enable bulk disclosure” identifies an asset, weakness and consequence.

Risk registers should be reviewed after major system changes, incidents, new vulnerabilities, changes in law or regulation, supplier changes and periodic assurance activities. They should not become static administrative documents.

5. Risk Treatment Decisions

Risk treatment normally involves four broad choices:

  1. Avoid: stop the activity or remove the exposure. For example, discontinue an unnecessary public database service.
  2. Reduce or modify: implement controls to lower likelihood or impact. Examples include segmentation, encryption, access control, patching and monitoring.
  3. Transfer or share: move part of the financial or operational consequence through insurance, contractual arrangements or an external service. Transfer does not remove accountability or eliminate the underlying risk.
  4. Accept or retain: consciously tolerate the risk within approved limits. Acceptance should be informed, documented, time-bounded where appropriate and approved by an accountable authority.

Controls can also be classified by function:

  • Preventive: block an unwanted event, such as parameterised queries.
  • Detective: identify activity, such as database audit logs.
  • Corrective: restore or repair, such as tested backups.
  • Deterrent: discourage behaviour, such as visible monitoring notices.
  • Compensating: provide an alternative safeguard when the preferred control is impractical.

Treatment selection should consider effectiveness, cost, operational impact, usability, maintainability and residual risk. A technically strong control that administrators routinely bypass may be less effective than a well-integrated control that is consistently used.

6. Applied Case: The Exposed Reporting Database

This is an illustrative case rather than a report of a real organisation.

Background

A medium-sized health-services provider operates a production database containing patient identifiers, appointment information and billing records. A reporting server receives extracts every night. Analysts connect to the reporting server from office networks and occasionally from home.

Problem

A security review discovers that the reporting database is reachable from the public internet. It uses a shared analyst account, stores unencrypted extracts for twelve months and sends alerts only when the database service stops. The reporting account can read every table, although most analysts need only aggregated appointment data.

Analysis

The assets include patient data, reporting availability, credentials and regulatory trust. Plausible threat events include automated exploitation of the exposed service, password compromise, insider bulk export and inference from small statistical groups.

The principal vulnerabilities are public exposure, shared authentication, excessive privilege, weak retention, absent encryption and inadequate monitoring. The likelihood of unauthorised access is rated 4, and the impact is rated 5 because disclosure could cause serious privacy, legal and reputational harm. Using the screening model, the initial risk score is 20 out of 25.

Approach and solution

The provider first removes public exposure and permits access through a controlled private connection. It replaces the shared account with individual identities and multi-factor authentication, creates role-based views, and gives analysts access only to approved columns and aggregated results. Extracts are encrypted, retention is reduced to the documented business need, and production data is masked before use in development.

Database activity monitoring is configured for bulk exports, unusual access times and access to sensitive tables. Logs are sent to a separate security-monitoring system. The provider tests restoration from protected backups and establishes a quarterly access review. Small-group reporting is suppressed to reduce inference risk.

Outcome

The controls reduce the likelihood of external compromise and accidental disclosure. They also improve accountability because actions can be linked to individual identities. Some residual risk remains: authorised users may still misuse access, and a compromised analyst workstation could expose approved data. These risks are recorded, assigned owners and reviewed.

Learning points

  1. A reporting environment can be as sensitive as production.
  2. Exposure is created by combinations of weaknesses, not only by software defects.
  3. Least privilege reduces both accidental and malicious disclosure.
  4. Encryption, monitoring and backups address different security objectives.
  5. Inference and aggregation must be considered in analytics systems.
  6. Risk treatment requires business ownership, not only technical action.

7. Governance, Ethics and Professional Practice

Database professionals often work with information about identifiable people. Security decisions must therefore respect privacy, fairness, proportionality and legitimate purpose. Collecting excessive data “just in case” increases harm if the data are misused or breached. Access should be based on a genuine role requirement, and individuals should not be monitored more extensively than necessary for security and accountability.

Legal and regulatory obligations vary by jurisdiction and sector, but common themes include lawful processing, purpose limitation, data minimisation, accuracy, retention control, security safeguards, breach response and accountability. Contracts with suppliers should address access, incident notification, subcontracting, data location, deletion and audit rights.

Professionals should preserve evidence during investigations, avoid accessing unrelated personal information, document decisions and escalate serious weaknesses. Security testing must be authorised and carefully scoped. Using live personal data in experiments or demonstrations without approval is unethical and may be unlawful.

8. Contemporary Developments and Limitations

Cloud databases and database-as-a-service platforms can improve resilience and reduce infrastructure burden, but they introduce shared-responsibility issues. The provider may secure the platform while the customer remains responsible for identities, data, configuration and access policies. Cloud permissions can also create large attack surfaces through automated provisioning and interconnected services.

Artificial intelligence can help identify unusual queries, classify sensitive data and prioritise vulnerabilities. However, AI-generated alerts may produce false positives, miss novel behaviour or expose sensitive data to an external service. AI should support, not replace, human review, documented risk criteria and access governance. Models themselves may become targets if training data, prompts or outputs contain confidential information.

No risk method is perfectly objective. Qualitative ratings may be influenced by organisational bias, incomplete evidence or pressure to reduce apparent risk. Quantitative estimates can create false confidence when incident data are sparse. Risk assessment should therefore record assumptions, uncertainty, evidence quality and the reasoning behind ratings.

Best-Practice Checklist

  • Maintain an inventory of databases, copies, backups, interfaces and owners.
  • Classify data according to sensitivity and business impact.
  • Remove unnecessary public exposure and services.
  • Use individual authentication, multi-factor authentication and least privilege.
  • Separate development, test, reporting and production environments.
  • Use parameterised queries and secure application development practices.
  • Patch supported software and monitor configuration drift.
  • Encrypt sensitive data in transit and at rest, while protecting keys separately.
  • Log privileged access, sensitive queries and bulk exports.
  • Protect logs from unauthorised alteration.
  • Test backup restoration and prepare for ransomware.
  • Review supplier and service-account access regularly.
  • Apply retention, masking, suppression and secure disposal.
  • Maintain a current risk register with accountable owners.
  • Reassess risk after changes, incidents and emerging threats.

Chapter Summary

Database risk arises from the interaction of valuable assets, threat actors, vulnerabilities and consequences. Threats may come from criminals, insiders, suppliers, automated systems or state-sponsored groups. Attack surfaces include databases, applications, APIs, identities, backups, cloud controls and development environments. Misconfiguration, injection, malware, insider misuse, inference, aggregation and leakage represent distinct but related risks.

A sound assessment identifies assets and owners, describes credible threat events, documents enabling vulnerabilities, evaluates likelihood and impact, and records inherent and residual risk. A risk register turns analysis into accountable action. Treatment may avoid, reduce, transfer or accept risk, using preventive, detective, corrective, deterrent and compensating controls. Technical safeguards must be combined with governance, ethical practice, privacy protection, monitoring, recovery planning and continuous review.

Key Terms

Threat: A potential cause of harm to an asset.

Threat actor: A person, group or organisation capable of causing a security event.

Vulnerability: A weakness that can be exploited by a threat.

Attack surface: The interfaces and pathways through which a system may be attacked.

Misconfiguration: An insecure or inappropriate system, access or operational setting.

Malware: Malicious software designed to perform unauthorised actions.

Insider threat: Risk arising from a person with legitimate organisational access.

Inference: Deriving protected information from permitted information.

Aggregation: Combining data items to create a more sensitive or revealing collection.

Data leakage: Unauthorised exposure, transmission or disclosure of information.

Asset: Something valuable that requires protection.

Confidentiality: Protection against unauthorised disclosure.

Integrity: Protection against unauthorised or inaccurate alteration.

Availability: The property of being accessible when required.

Likelihood: An assessment of how probable a threat event is.

Impact: The severity of consequences if an event occurs.

Inherent risk: Risk before considering controls.

Residual risk: Risk remaining after controls are applied.

Risk register: A controlled record of risks, owners, treatments and review information.

Least privilege: Granting only the access necessary for an authorised task.

Review Questions

Short Answer Questions

  1. Distinguish between a threat, vulnerability and risk.
  2. Identify four common database attack surfaces.
  3. What is the difference between inference and aggregation?
  4. Why are shared accounts problematic in database environments?
  5. State the four broad risk-treatment choices.

Long Answer Questions

  1. Explain how a database risk assessment should identify assets, threats, vulnerabilities, likelihood and impact.
  2. Discuss how misconfiguration can create database exposure even when the database software contains no known vulnerability.
  3. Compare the security implications of malicious insiders, negligent insiders and compromised legitimate accounts.
  4. Explain why backups, logging and access control address different aspects of database resilience.
  5. Discuss the ethical and governance responsibilities involved in monitoring database users.

Analytical / Application Questions

  1. A reporting account can read all production customer tables, although it is used only for monthly regional totals. Analyse the risks and recommend a treatment plan.
  2. A database has a likelihood rating of 4 and an impact rating of 5 on a five-point scale. Calculate its screening risk score using Risk score = Likelihood × Impact, then explain why the score should not be treated as a precise probability.
  3. Design three risk-register entries for a cloud database: one concerning public exposure, one concerning excessive privileges and one concerning untested backups. For each, identify an asset, threat event, vulnerability, treatment and residual-risk consideration.

Multiple Choice Questions with Answers

Question 1

Which statement best distinguishes a vulnerability from a threat?

A. A vulnerability is a weakness; a threat is a potential cause of harm.

B. A vulnerability is always an attack; a threat is always a control.

C. A vulnerability measures impact; a threat measures availability.

D. A vulnerability is a business asset; a threat is a database backup.

Correct Answer: A. A vulnerability is a weakness; a threat is a potential cause of harm.

Question 2

Which practice most directly reduces SQL injection risk?

A. Increasing database storage capacity

B. Using parameterised queries

C. Disabling database backups

D. Sharing one administrator account

Correct Answer: B. Using parameterised queries

Question 3

An analyst combines publicly available age, address and transaction data to identify a person’s purchasing behaviour. This is primarily an example of:

A. Aggregation

B. Patch management

C. Availability

D. Network segmentation

Correct Answer: A. Aggregation

Question 4

What is the main security weakness of a shared database account?

A. It increases storage costs

B. It prevents encryption at rest

C. It weakens individual accountability and access review

D. It guarantees database availability

Correct Answer: C. It weakens individual accountability and access review

Question 5

Which control is primarily detective?

A. Parameterised queries

B. Database activity monitoring

C. Removal of an unnecessary service

D. Data masking before development use

Correct Answer: B. Database activity monitoring

Question 6

A risk has likelihood 4 and impact 5 on a five-point scale. Using Risk score = Likelihood × Impact, what is the screening score?

A. 9

B. 20

C. 25

D. 45

Correct Answer: B. 20

Question 7

Which option is an example of risk avoidance?

A. Encrypting an existing database backup

B. Buying cyber insurance

C. Accepting the risk without further action

D. Discontinuing an unnecessary internet-facing database service

Correct Answer: D. Discontinuing an unnecessary internet-facing database service

Question 8

What is residual risk?

A. Risk remaining after controls are applied

B. Risk before any asset is identified

C. Risk that exists only in a test environment

D. Risk caused exclusively by malware

Correct Answer: A. Risk remaining after controls are applied

Question 9

Which situation presents an inference risk?

A. A server is powered off during maintenance

B. A user derives a sensitive conclusion from a permitted small-group statistical result

C. A backup is restored successfully

D. A patch is installed on a database server

Correct Answer: B. A user derives a sensitive conclusion from a permitted small-group statistical result

Question 10

Which statement about risk scores is most accurate?

A. They are always precise probabilities of attack.

B. They eliminate the need for managerial judgment.

C. They are prioritisation aids whose meaning depends on defined scales and assumptions.

D. They measure only confidentiality and never integrity or availability.

Correct Answer: C. They are prioritisation aids whose meaning depends on defined scales and assumptions.

Database & Information Security
Chapter 3 of 15