← Back to Methodology
paper-002

Security Drift

How ordinary change crosses security boundaries in long-lived Magento systems—and how repeated assessment makes it visible.

Son Cao

Abstract

Software must change in order to remain useful. Requirements are added, modules are installed or removed, dependencies are upgraded, hotfixes are applied, production servers are modified, and external APIs evolve. Most of these changes are legitimate. Some leave the system within its accepted security boundary; others break conditions that previously passed.

This paper defines security drift as change in a system over time relative to an established security baseline. Drift is not automatically a failure. A system may change while every baseline rule continues to pass, producing acceptable drift. Attention is required when a change causes a previously satisfied rule to fail. The failed rule identifies the boundary that was crossed, but it does not explain the cause or prescribe the remedy. That work still requires review, system knowledge, and clear application-security responsibility.

Magento illustrates the problem particularly well. A long-lived store is a composition of core behavior, custom code, modules, integrations, configuration, infrastructure, and years of operational decisions. Supported extension mechanisms can change effective core behavior without modifying core files. A new module may be correct in isolation while interacting poorly with a system that predates it by many years. AI-assisted development increases the rate at which such changes can be introduced, often faster than a team can understand their combined effects.

Security drift becomes dangerous when it remains unreviewed. It may stay invisible, accumulate with other weaknesses, or become part of the path to a later incident. Repeated baseline assessment makes that hidden change observable and provides a point from which the system can be restored.

1. A Changing System Is Not Necessarily a Broken System

A security baseline is sometimes mistaken for a frozen image of an application. Under that interpretation, every difference from a previous state would be treated as a problem. Such a baseline would not remain useful for long. Production software must evolve, and an ecommerce system that cannot change cannot respond to its business.

A Magento project may add a promotion, replace a payment provider, upgrade the platform, install a module, remove an obsolete integration, or adjust infrastructure for a sales period. These changes alter the system, but they do not necessarily weaken it.

The baseline therefore does not define one exact implementation. It defines a set of security conditions within which implementations may change.

A baseline does not prevent change. It defines the conditions within which change remains acceptable.

Consider a module upgrade. The package version, files, dependencies, and runtime behavior may all change. If every rule selected for the project baseline still passes, the change remains inside the accepted security boundary. The system has drifted from its previous technical state, but the drift is acceptable with respect to that baseline.

This distinction allows security and development to coexist. The objective is not to stop the system from moving. It is to recognize when movement crosses a boundary that the project previously decided to maintain.

2. Acceptable Drift and Security-Relevant Drift

Drift begins with change, not failure. The result of that change determines whether attention is required.

System changes
        ↓
Run the current project baseline
        ↓
All selected rules pass?
    Yes                No
     ↓                  ↓
Acceptable drift   Security-relevant drift
                   Review required

Acceptable drift

Acceptable drift occurs when the system changes while all selected baseline rules continue to pass. The implementation is different, but the security expectations represented by the baseline still hold.

Examples may include:

  • deploying a feature that preserves authorization and input-handling requirements;
  • upgrading a module without introducing a vulnerable dependency;
  • changing an integration while authentication, transport, and secret-handling rules remain satisfied;
  • scaling production infrastructure without weakening its security configuration; or
  • upgrading Magento while the selected application and operational controls continue to pass.

A passing result does not prove that the change has no defect. Functional, performance, architectural, or security problems may exist outside the scope of the selected rules. It establishes only that the observable conditions represented by the baseline remain satisfied.

Security-relevant drift

Security-relevant drift occurs when change causes one or more baseline rules to fail. A condition that the project had previously reached and accepted no longer holds.

Before change: rule passes
After change:  rule fails

The failed rule is evidence that the system crossed a defined boundary. It is not yet evidence of why the boundary was crossed. The cause may be in application code, module composition, infrastructure, configuration, an external service, or a temporary workaround introduced during an operational event.

This paper uses “security drift” broadly for system change over time and “security-relevant drift” for change that breaks the baseline. In everyday operation, the shorter term “drift” may be used for the latter because it is the point at which action becomes necessary.

3. Where Drift Comes From

Security drift usually enters through legitimate work. Common sources include:

  • new business requirements;
  • installation or removal of modules;
  • Magento, PHP, library, or module upgrades;
  • emergency hotfixes;
  • direct changes to production servers;
  • deployment and infrastructure changes;
  • modifications to configuration or permissions;
  • changes in a partner API;
  • replacement of payment, logistics, analytics, or other integrations; and
  • debugging work performed under time pressure.

None of these activities is inherently insecure. Risk arises because each activity changes assumptions that other parts of the system may depend on.

An API partner may change authentication or payload behavior. A developer then updates the integration so that orders continue to flow. The immediate requirement is functional: restore the connection. During that work, logging may become more verbose, a temporary credential may be placed in configuration, or validation may be relaxed to accommodate an unexpected response. The integration works again, but a baseline condition may no longer hold.

A module removal can create drift as easily as an installation. Removing a package may also remove an observer, a security header, an authorization check, or a dependency that another customization assumed would remain present. The absence of code can change effective behavior just as much as its addition.

Drift is therefore better understood as an effect of system evolution than as a category of developer mistake.

4. Availability First, Security Later

Operational incidents reveal how drift becomes persistent.

Suppose a Magento project is upgraded. Core behavior changes, and a function that worked in the previous version no longer works in production. Developers debug the failure, change dependency configuration, add a hotfix, or bypass part of an existing flow. At that moment, keeping the store available is the most urgent objective.

The priority sequence often looks like this:

Restore availability
→ stabilize the function
→ recover acceptable performance
→ return to security review

This order reflects business reality. An unavailable checkout has an immediate and measurable cost. A weakened security condition may have no visible effect at the time it is introduced.

Temporarily deferring security work can therefore be a necessary operational decision. The larger risk is that the final step never happens. Once the system is working again, the team moves to the next release or incident. The hotfix becomes part of production, the reason for it becomes less clear, and the deferred review disappears from attention.

Deferring security during an operational emergency may be necessary. Failing to resume it after the system stabilizes turns a temporary compromise into persistent risk.

A repeated baseline assessment provides a deliberate return point. When the urgent work is over, it shows which selected conditions no longer pass. The team does not have to reconstruct every action taken during the incident before it knows where to begin reviewing.

5. Effective Behavior Can Drift Without Core Modification

Magento permits modules to change application behavior without editing core source files. Preferences, plugins, dependency-injection composition, observers, configuration merging, and related extension points make the platform flexible. They also mean that the behavior executed at runtime may differ substantially from the behavior visible in the original core class.

In this paper, these are treated collectively as behavioral modification mechanisms: supported mechanisms that change how core functions behave without directly changing core code.

The distinction matters:

Core files remain unchanged
≠
Core behavior remains unchanged

A preference can replace an implementation. A plugin can run before, after, or around a method. Multiple observers can respond to an event. Dependency configuration from many modules can be combined into the object graph used at runtime. Each mechanism is legitimate, and each can participate in behavior that is difficult to understand from any single file.

A module may be correct in isolation and still be unsafe in composition.

For example, a new module may follow Magento conventions and satisfy its immediate requirement. Elsewhere in the project, however, an older module may already replace the same behavior, depend on the previous execution order, or assume an undocumented result. Introducing the new module changes the composition. The defect emerges from the interaction rather than from an obvious error inside either module.

This is common in long-lived systems. A Magento project may contain modules that have been operating for ten years, along with rewrites, integrations, and hotfixes whose original authors are no longer available. The current team may understand each recent change while lacking a complete model of all the historical assumptions that change will encounter.

Supported extension does not remove drift. It often moves drift away from visible core modifications and into the composition of behavior.

6. Local Correctness Is Not System Safety

A useful review of a new module asks several different questions:

Is the code syntactically valid?
        ↓
Does the module satisfy its local requirement?
        ↓
Does it integrate correctly with the existing project?
        ↓
Does the composed system remain within its security baseline?

These questions are related but not interchangeable.

Code may compile and a module may work in its principal test case while the overall system has become less safe. An authorization flow may be bypassed on a secondary route. A plugin may prevent a security check from executing. A dependency may introduce a known vulnerability. Debug information may be written to logs. A hotfix added to resolve the conflict may relax a control elsewhere.

Integration testing helps reveal functional interaction. Performance testing reveals some operational consequences. Baseline assessment adds another perspective: whether the changed system still satisfies its selected security rules.

The baseline does not ask only whether a new module works. It asks whether the composed system still satisfies its accepted security conditions after the module is introduced.

The baseline cannot observe every interaction. A rule must exist for the condition, and the check must have access to meaningful evidence. Some defects remain outside its scope. The value of the baseline is not completeness; it is the consistent re-evaluation of conditions the project has explicitly chosen to maintain.

7. Drift at Machine-Generated Speed

AI-assisted development does not create the complexity of a long-lived Magento project. Much of that complexity existed years before modern code-generation tools. AI changes the speed at which new code can be introduced into it.

A developer can ask for a module that meets a local requirement and receive a plausible implementation quickly. The generated code may understand the prompt and common Magento APIs. It may know little about the complete system in which the module will live: legacy preferences, existing plugin chains, undocumented integration behavior, historical hotfixes, or assumptions embedded in modules written long before the AI tool existed.

This creates a velocity-understanding gap: the distance between how quickly a team can produce change and how well it understands the consequences of that change.

Generation capacity increases
        ↓
More code and modules can be introduced
        ↓
Review capacity does not increase at the same rate
        ↓
More interactions remain poorly understood

The concern is not that AI-generated code is automatically insecure. Manually written code can create the same problems. The concern is loss of ownership and context when the rate of change exceeds the team's ability to explain, review, and support what it deploys.

A generated module may be:

  • syntactically valid;
  • locally correct;
  • compatible with a clean Magento installation; and
  • incompatible with the actual production composition.

The baseline does not need to determine whether code was written by a human or generated by a model. It evaluates consequences:

Whether code is written manually or generated, the same project security rules must continue to hold.

This is a useful guardrail, but not a substitute for review. A passing baseline cannot make generated code trustworthy, prove that the architecture is sound, or detect every interaction defect. It can prevent some security consequences of rapid change from remaining invisible.

8. A Failed Rule Is the Start of Review

When a repeated assessment produces a failed rule, the scan has completed its technical task. The application-security task has just begun.

The failed rule answers one question:

Which accepted condition no longer holds?

It does not necessarily answer:

  • Which change caused the failure?
  • Was the change intentional?
  • What other components were affected?
  • How much practical risk does the failure create?
  • Should the system be rolled back, patched, or redesigned?
  • Does the business requirement itself need review?

Those questions require a responsible person who can investigate the system in context. The work normally includes reviewing recent changes, identifying the relevant code or configuration, understanding interaction with existing modules, selecting remediation, and running the baseline again.

Scan
→ failed rule
→ AppSec review
→ root-cause analysis
→ remediation
→ re-scan
→ baseline restored

Automation identifies the broken expectation. Human review determines what broke it, why it matters, and how the system should be restored.

This responsibility cannot end with delivery of a report. A finding without ownership can remain open indefinitely, especially when the application appears functional. Continuous assessment therefore requires continuous accountability: someone must be responsible for following failed rules through review and remediation.

9. Drift or a Legitimate Baseline Revision?

A failed rule normally calls for remediation against the current baseline. It should not be removed merely because making it pass is inconvenient.

There are cases, however, in which the project itself has legitimately changed. A new payment flow may expand compliance scope. A new integration may require additional controls. A removed capability may make an existing rule no longer applicable. In such cases, the business requirement and risk context should trigger a review of the baseline.

The distinction is:

Unexpected or unreviewed change
→ keep the current baseline
→ fix the system

Legitimate requirement change
→ review security impact
→ add or remove appropriate rules
→ establish the next project baseline version

A system failure is not a reason to redefine success. Baseline revision is a governance decision, not a convenient response to a red result.

When review determines that the accepted rule set must change, the project may move from Baseline v1 to v1.1 or v1.2. The new version records a change in the project's security expectations. Routine scans, failures, and remediation do not create new baseline versions when the requirements remain the same.

This separation preserves the baseline as a useful reference while allowing it to evolve with the business.

10. From Hidden Drift to Latent Risk

Unreviewed drift can remain invisible because the system may continue to perform its primary business function. Orders are placed, payments are processed, and administrators can operate the store. A broken security condition may not produce an immediate symptom.

That invisibility is what makes drift dangerous. The failed condition may persist, combine with another weakness, or reduce the effort required for a later attack. A verbose log may expose a credential only after another party gains log access. A relaxed permission may matter only when a separate vulnerability allows code execution. An outdated module may remain untouched until a public exploit appears.

It would be too strong to claim that every drift inevitably becomes an incident. Acceptable drift may never create a security problem, and even a failed rule does not guarantee exploitation. The defensible claim is narrower:

Unreviewed security drift creates latent risk. It may remain dormant, accumulate with other weaknesses, or become part of the path to a future incident.

Without repeated assessment, the organization may not know that the condition changed. The absence of an incident is then mistaken for evidence that the system remains safe.

A baseline changes that relationship. It does not eliminate uncertainty, but it makes selected forms of change observable before an incident is required to reveal them.

Conclusion

Security drift is a natural consequence of software evolution. Magento projects change through requirements, modules, upgrades, integrations, hotfixes, infrastructure work, and operational recovery. Those changes are necessary, and many remain within the accepted security boundary.

The important moment occurs when a change causes a previously satisfied baseline rule to fail. The failure identifies an expectation that no longer holds. It does not explain the cause or complete the remediation. Review, system knowledge, and AppSec ownership are still required.

Long-lived Magento systems make this especially important. Their effective behavior is composed from core code and years of modules, dependency configuration, plugins, observers, integrations, and fixes. A module can be valid in isolation while producing unsafe interaction in the composed system. AI-assisted development increases the velocity of new changes inside that existing complexity, making the gap between generation and understanding harder to ignore.

A baseline gives the project a stable boundary without freezing development. Change may continue as long as the selected rules continue to pass. When a rule fails, the drift becomes visible and can be investigated. When business requirements legitimately change, the baseline can be reviewed and versioned rather than silently weakened.

The objective is not to prevent movement. It is to know when movement has crossed a security boundary and to ensure that someone is responsible for bringing the system back.