The vulnerability arises from Bundler 1.x's handling of multiple gem sources. When a secondary source is specified (even with scoping), the resolver prioritizes it globally due to flawed source aggregation logic. The SourceList#aggregate_global_source method merges all sources into a global list, bypassing scoping constraints. The Resolver#resolve method then selects gems from this aggregated list, allowing malicious gems from secondary sources to override legitimate ones. These functions are central to the vulnerability, as confirmed by the documented behavior where scoped sources unexpectedly affect all gems. The Bundler team addressed this in 2.0 by redesigning source handling, further implicating these components.