Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.
This repository was archived by the owner on May 29, 2026. It is now read-only.

[HIGH] H8: performContactSync strips organisatie field before save — data corruption window on every cron pass #340

Description

@rubenvdlinde

Severity: HIGH

Location: lib/Service/OrganizationSyncService.php lines 407–468 (performContactSync), specifically lines 431–432

Description:
performContactSync deliberately strips the organisatie field from a contact object before calling saveObject, then attempts to restore it on failure. This bypasses schema validation for what appears to be a circular-reference issue, but introduces a data-corruption window: any consumer (API request, event listener, another cron task) that reads the contact between the unset and the saveObject call sees a record with no organisatie value.

On high-load instances with overlapping cron runs this window grows, and contacts can be permanently saved without their organisation if the service is killed mid-way.

Suggested fix:
Fix the underlying schema or data normalization issue rather than stripping and restoring data at runtime. Do not mutate the entity in ways that temporarily violate its own schema invariants.


Source: deep team-reviewer pass 2026-05-27

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions