@@ -616,6 +616,14 @@ def osv_query(search_string, page, affected_only, ecosystem):
616
616
# yapf: enable
617
617
result_items = [bug_to_response (bug , detailed = False ) for bug in bugs ]
618
618
619
+ # Filter isFixed flag to apply only for selected ecosystem.
620
+ if ecosystem :
621
+ eco_variants = osv .ecosystems .add_matching_ecosystems ({ecosystem })
622
+ eco_variants .add (osv .ecosystems .normalize (ecosystem ))
623
+
624
+ for item , bug_obj in zip (result_items , bugs ):
625
+ item ['isFixed' ] = _is_fixed_in_ecosystem (bug_obj , eco_variants )
626
+
619
627
results = {
620
628
'total' : total_future .get_result (),
621
629
'items' : result_items ,
@@ -624,6 +632,26 @@ def osv_query(search_string, page, affected_only, ecosystem):
624
632
return results
625
633
626
634
635
+ def _is_fixed_in_ecosystem (bug : osv .Bug , eco_variants : set [str ]) -> bool :
636
+ """Determine if a bug has a fix within the specified ecosystem variants.
637
+
638
+ Args:
639
+ bug: The Bug entity.
640
+ eco_variants: Set of ecosystem names (including variants) to match.
641
+
642
+ Returns:
643
+ True if any affected package in the ecosystem has a fixed/limit event.
644
+ """
645
+ for affected_pkg in getattr (bug , 'affected_packages' , []):
646
+ pkg = affected_pkg .package
647
+ if not pkg or pkg .ecosystem not in eco_variants :
648
+ continue
649
+ for r in affected_pkg .ranges or []:
650
+ if any (evt .type in ('fixed' , 'limit' ) for evt in (r .events or [])):
651
+ return True
652
+ return False
653
+
654
+
627
655
def get_vuln_count_for_ecosystem (ecosystem : str ) -> int :
628
656
ecosystem_counts = osv_get_ecosystem_counts_cached ()
629
657
if not ecosystem :
0 commit comments