Large-File Scan Evasion: Analyzing a Third-Party Code Repository Intrusion Chain

    Public security research describes a supply chain intrusion in which attackers compromised 42 third-party code repositories and used large payload files to evade platform search and API discovery. The campaign combined repository abuse, package ecosystem poisoning, CI/CD workflow manipulation, and native plugins with execution hooks for AI coding assistants and IDEs. Key artifacts included 13.7MB polymorphic wrappers decoding to a hidden CI publisher payload, repositories used as encrypted data collection points, a compiled native plugin that decrypts a cached file at runtime, account hijacking, forged commit timelines, short-lived release branches, and leaked registry credentials. The article breaks down the attack chain, explains why large files and polymorphic packaging bypass scanning, and outlines detection and protection measures spanning repositories, package registries, CI workflows, cloud audit logs, and sandboxed analysis.

    1. Event Overview and Core Conclusions

    Public security research shows that in one supply chain intrusion campaign, attackers compromised 42 third-party code repositories and deployed payload files large enough to bypass the search and API discovery paths that platforms typically use to detect such intrusions. Unlike previous campaigns that simply dropped malicious scripts, this attack showed a clear combined pattern: repositories, the package management ecosystem, CI/CD workflows, and native plugins were linked into a complete supply chain attack chain.

    Key indicators disclosed in the report include execution hooks in victim repositories targeting intelligent coding assistants and integrated development environments (IDEs), as well as 13.7MB polymorphic wrappers that ultimately decode to the same hidden CI publisher payload. Attacker-controlled repositories also served as encrypted data collection points for receiving snapshot envelope data. The attack also used a new disguise: a compiled native plugin that does not contain its own payload decrypts a cached file at runtime and then releases the real payload. The investigation also found account hijacking, forged commit timelines, short-lived release branches, and leaked package registry credentials. Control-panel-related traces in the same hijacked owner cluster link the victim infrastructure to earlier CI workflow attack campaigns targeting internet-facing control panel systems.

    From a defensive perspective, the core conclusion is that attackers are exploiting gaps among platform indexing, scanning thresholds, and static analysis boundaries to combine large-file evasion, polymorphic packaging, install-time execution, native plugin delayed decryption, and credential lateral movement into a low-visibility attack chain. Relying on traditional malicious file matching alone is no longer sufficient to cover this type of risk.

    2. Attack Chain Breakdown

    2.1 Initial Access and Account Hijacking

    The starting point of the attack chain is usually related to credential leakage, token abuse, or account hijacking. Once attackers obtain valid credentials for a code hosting platform or package registry, they can act as legitimate users to commit, create branches, publish package versions, or modify CI configurations. Because these operations appear to follow normal development processes, authentication alone is insufficient to detect anomalies. Forged commit timelines and short-lived release branches further increase audit difficulty: short-lived branches are deleted quickly after payload delivery, and commit timelines are disguised as a normal development cadence, making retrospective tracing more difficult.

    2.2 Package Management Ecosystem Poisoning and Install-Time Execution

    The package management ecosystem is an important propagation surface in this attack chain. Malicious versions abuse the extension capabilities of build configuration files to execute entry scripts during installation, even if these packages do not declare traditional install scripts. The loader applies a per-version changing Caesar cipher transformation to character code arrays, decrypts AES-128-GCM stage content, and locates or downloads a specific version of a script runtime. Depending on the version, the decrypted payload is piped to the runtime for execution or written to a temporary directory for execution and then deleted after execution.

    The full payload collects credential information, pollutes repositories and CI configurations, and continues to spread through package registries. Attacker-controlled repositories serve as cover project sources for matching package versions, making malicious packages appear to have corresponding source repositories and release context. This mutual endorsement between repositories and package registries significantly increases the deception of supply chain attacks.

    2.3 Repository Persistence and Data Collection

    On the repository side, attackers use very large files and polymorphic wrappers to carry payloads. The 13.7MB polymorphic wrapper is not a normal static file; it uses polymorphic transformation to reduce feature-matching hit rates and ultimately decodes to the same hidden CI publisher payload. Compromised repositories also serve as encrypted data collection points that receive snapshot envelope data, indicating that attackers may be exfiltrating credentials and runtime environment data as well as polluting code.

    2.4 Native Plugin Delayed Decryption

    A newer disguise in this attack is the payload-free native plugin: the compiled plugin itself contains no obvious malicious payload, so static scanning cannot directly determine malice; at runtime it decrypts a cached file and reveals the true payload. This delayed decryption strategy moves malicious behavior to the runtime stage and bypasses static detection centered on file content.

    3. Why Large Files and Polymorphic Wrappers Bypass Scanning

    Large files can bypass security scans typically due to the following mechanisms:

    1. Platform indexing and search limits: Code hosting platform search and API indexing often have boundaries for file size, file type, or binary content. Files above the threshold may not be fully indexed, and attackers use this gap to hide payloads.
    2. Scanner thresholds and performance trade-offs: To control cost and latency, security scanners often apply sampling, skipping, or shallow inspection to very large files, archives, and binaries.
    3. Polymorphism and encoding transformation: Polymorphic wrappers change file features through per-version variation, encoding transformations, and fragment combination, defeating detection based on hashes and fixed features.
    4. Separation of static and dynamic analysis: Native plugins decrypt cached files only at runtime, so static scanning cannot see the real payload, while dynamic analysis may miss the window due to environment differences, execution from temporary directories, and deletion after execution.
    5. Audit timeline interference: Forged commit timelines, short-lived branches, and rapid deletion reduce the probability of discovery based on historical diffs and branch audits.

    Defenders should therefore treat file size thresholds as risk signals, not as reasons to skip scanning. They should establish combined detection strategies for large files, binary plugins, compressed wrappers, and execution from temporary directories.

    4. Impact and Risk

    The impact of such attacks is not limited to a single repository. First, leaked code hosting credentials and package registry credentials may be used to access third-party repositories, enabling lateral movement. Second, after CI configurations are polluted, build artifacts may be backdoored, affecting downstream users. Third, malicious versions in the package management ecosystem spread through dependencies and expand the affected scope. Fourth, encrypted data collection points and snapshot envelope data indicate that attackers may continuously collect runtime environment information, increasing the risk of data exfiltration. Finally, forged commit timelines and short-lived release branches undermine audit credibility and create challenges for compliance forensics.

    5. Detection and Protection Recommendations

    5.1 Platform and Repository Side

    • Establish mandatory deep-scan queues for large files above indexing thresholds, and recursively inspect embedded objects, archives, and binary content.
    • Audit the origin, signatures, and runtime behavior of native plugins and compiled artifacts, focusing on runtime reads of cached files, writes to temporary directories, child process creation, and network download behavior.
    • Monitor CI workflow configuration changes and set alerts for new release steps, credential reads, network downloads, and execution from temporary directories.
    • Detect patterns such as abnormal commit timelines, frequent creation and deletion of short-lived branches, and rapid merging of release branches.
    • Apply least privilege, multi-factor authentication, and regular credential rotation to repository owners and publishing accounts.

    5.2 Package Management Ecosystem Side

    • Sandbox-monitor install-time execution and prohibit fetching executable content from the network during installation.
    • Require release approval for build configuration extension capabilities, and require verifiable correspondence among package versions, source repositories, and build artifacts.
    • Quickly rotate leaked package registry credentials and limit the scope and lifetime of publishing tokens.

    5.3 Cloud Audit and Centralized Alerting

    In cloud environments such as Baidu AI Cloud, CI run logs, artifact repository access logs, and network egress logs can be connected to a logging service, with monitoring alerts configured. Object storage can retain build artifacts and audit snapshots, and container platforms can isolate untrusted build jobs. These capabilities support centralized auditing and alerting, but the core of protection remains a combination of policies and least privilege.

    5.4 Illustrative Detection Policy

    1. Scanning policy:
    2. if file_size > platform_index_threshold:
    3. enqueue_for_deep_scan
    4. unpack_and_recursively_inspect_embedded_objects
    5. perform_decoding_and_dynamic_analysis_in_sandbox
    6. if plugin_is_native_binary:
    7. check_whether_it_reads_cache_or_temp_directory_at_runtime
    8. log_network_downloads_child_process_creation_and_file_deletion
    9. CI policy:
    10. prohibit_fetching_executable_content_from_network_during_install
    11. prohibit_writing_to_CI_configuration_and_credential_directories
    12. prohibit_executing_unsigned_binaries_from_temp_directories
    13. enforce_minimum_retention_and_two-person_approval_for_release_branches

    6. Summary

    The compromise of 42 third-party code repositories shows that supply chain attacks have evolved from single malicious packages into a combined chain of repository cover, package registry propagation, CI configuration pollution, and native plugin delayed decryption. Large files and polymorphic wrappers are effective because they precisely exploit gaps among platform indexing, scanning thresholds, and static analysis boundaries. Defenders should treat large files as high-risk inputs; bring install-time execution, temporary-directory execution, native plugin runtime decryption, and CI configuration changes into a unified detection surface; and improve discovery probability through least-privilege credentials, workflow change monitoring, and sandbox dynamic analysis. Only by linking protection across platforms, repositories, and the package management ecosystem can organizations effectively reduce the depth of impact from such stealthy supply chain intrusions.