Skip to content

Commit 2bcecde

Browse files
committed
fix: remove data layer anchor tag sanitization, keep frontend-only fix
Signed-off-by: Vasu <[email protected]>
1 parent 9b240f2 commit 2bcecde

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

osv/sources.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -163,21 +163,10 @@ def _get_nested_vulnerability(data, key_path=None):
163163
return data
164164

165165

166-
def _sanitize_anchor_tags(text):
167-
if not text or not isinstance(text, str):
168-
return text
169-
pattern = r'<a\s+[^>]*name=["\'][^"\']*["\'][^>]*>\s*</a>|<a\s+[^>]*name=["\'][^"\']*["\'][^>]*/>'
170-
return re.sub(pattern, '', text, flags=re.IGNORECASE)
171-
172-
173166
def parse_vulnerability_from_dict(data, key_path=None, strict=False):
174167
"""Parse vulnerability from dict."""
175168
data = _get_nested_vulnerability(data, key_path)
176169

177-
# Sanitize anchor tags from details field if present
178-
if isinstance(data, dict) and 'details' in data and data['details']:
179-
data['details'] = _sanitize_anchor_tags(data['details'])
180-
181170
try:
182171
jsonschema.validate(data, load_schema())
183172
except jsonschema.exceptions.ValidationError as e:

0 commit comments

Comments
 (0)