fixhunt

biome security/noBlankTarget

labelled safe
Runs / 2026-10-17T20-55-54-246Z-1g4l-biome-security_noBlankTargetbiome 2.5.152026-10-17 20:55 UTC8 programs × 2 round(s)16 programs, 0 fired, 0 fixed, 0 findings, 4 rejectedmodel cost $0.0037

Analysis Nemotron 3 Super

Flags `<a>` tags using `target="_blank"` without a mitigating `rel="noopener"` or `rel="noreferrer"` attribute.

Fix: Adds `rel="noopener"` to the existing attributes; if any `rel` value already exists, appends `noopener` as a space-separated token while preserving other tokens and their original order.

12 hazards
  • Adding `rel="noopener"` after user-defined `rel` values could change the semantic meaning if downstream code relies on the exact ordering of space-separated tokens for parsing or matching.
  • If the original `rel` attribute contained a value like `noopener` already, the fix would duplicate it (`rel="noopener noreferrer noopener"`), which is harmless but unnecessarily bloats the attribute.
  • When the anchor tag is generated via a template literal or JSX expression spread (`{...props}`), inserting `rel` statically might interfere with dynamic `rel` injection from props if those props also define `rel`, potentially causing conflicts or unexpected precedence.
  • The fix does not account for custom components that render an `<a>` internally; applying the fix to such a component would add `rel` to the component itself, which has no effect and may trigger prop-type warnings or errors.
  • If the JSX contains comments between `target="_blank"` and the closing `>` (e.g., `<a target="_blank" /* debug */ >`), the fixer might place the new `rel` attribute before or after the comment, altering comment positioning relative to attributes.
  • In server-side rendering contexts where the HTML string is later parsed by a browser, injecting `rel="noopener"` could affect how certain browser extensions or security policies interpret the link, though this is generally benign.
  • If the anchor tag uses a namespace prefix (e.g., `<svg:a target="_blank">`), the fixer might incorrectly treat it as an HTML anchor and add `rel`, which is invalid in SVG and could break the markup.
  • When the `href` attribute value is a JavaScript expression (e.g., `href={userInput}`), the fix does not validate the URL; adding `rel="noopener"` remains safe but does not mitigate risks from unsafe URLs themselves.
  • If the element is not actually an anchor (e.g., a custom component that destructures and spreads `target` and `rel` onto a child `<a>`), the fix adds `rel` to the wrong element, leaving the actual anchor unprotected.
  • In rare cases where `rel` is used as an event handler name via JSX spreading (`{...{ rel: onClick }}`), the fixer’s insertion of a static `rel` attribute could conflict with or override the dynamic handler, breaking event binding.
  • The fix preserves whitespace and formatting loosely; if the original JSX relied on precise formatting for prettier or linter compatibility, the insertion might shift indentation or line breaks in a way that triggers formatting complaints.
  • When `allowDomains` is configured, the fix may incorrectly add `rel="noopener"` to links pointing to allowed domains, which under that configuration should remain unchanged, thus over-fixing and deviating from user intent.

Programs

idresulttitlehazard
r1-p001silent prediction offRegex with escaped unicode flags and lastIndex mutationregular expressions: escapes, unicode flag, lastIndex with the g flag
r1-p002invalidCustom component renders <a> internally - fix applied to wrapperThe fix does not account for custom components that render an `<a>` internally; applying the fix to such a component would add `rel` to the component itself, which has no effect and may trigger prop-t
r1-p003silent prediction offSSR context where injected rel affects extension behaviorIn server-side rendering contexts where the HTML string is later parsed by a browser, injecting `rel="noopener"` could affect how certain browser extensions or security policies interpret the link, th
r1-p004silent prediction offallowDomains config leads to over-fix on allowed domainWhen `allowDomains` is configured, the fix may incorrectly add `rel="noopener"` to links pointing to allowed domains, which under that configuration should remain unchanged, thus over-fixing and devia
r1-p005silent prediction offASI hazard: leading paren after semicolon-less statementASI and semicolon-less code, leading ( or [ on the next line
r1-p006invalidFix applied to wrapper, actual anchor unprotected due to spreadIf the element is not actually an anchor (e.g., a custom component that destructures and spreads `target` and `rel` onto a child `<a>`), the fix adds `rel` to the wrong element, leaving the actual anc
r1-p007silent prediction offNull/undefined distinction with optional chainingnull/undefined distinction, optional chaining short-circuit, nullish vs falsy
r1-p008silent prediction offthis binding: arrow vs function method extractionthis binding: arrow vs function, methods extracted from objects, call/apply/bind
r2-p001silent prediction offTemplate literal with spread props interfering with static rel insertionWhen the anchor tag is generated via a template literal or JSX expression spread ({...props}), inserting rel statically might interfere with dynamic rel injection from props if those props also define
r2-p002silentSVG namespace prefix treated as HTML anchorIf the anchor tag uses a namespace prefix (e.g., <svg:a target="_blank">), the fixer might incorrectly treat it as an HTML anchor and add rel, which is invalid in SVG and could break the markup.
r2-p003silent prediction offRel token order changed affecting downstream parsingAdding rel="noopener" after user-defined rel values could change the semantic meaning if downstream code relies on the exact ordering of space-separated tokens for parsing or matching.
r2-p004silent prediction offVar hoisting and re-declaration in loop affecting rel handlingVar hoisting and re-declaration inside loops or after use
r2-p005silent prediction offDuplicate noopener added when already present in relIf the original rel attribute contained a value like noopener already, the fix would duplicate it (rel="noopener noreferrer noopener"), which is harmless but unnecessarily bloats the attribute.
r2-p006silent prediction offGetter/setter side effects on rel attributeGetters, setters and Object.defineProperty side effects
r2-p007invalidJSX comment between target and closing bracket displaced by rel insertionIf the JSX contains comments between target="_blank" and the closing > (e.g., <a target="_blank" /* debug */ >), the fixer might place the new rel attribute before or after the comment, altering comme
r2-p008invalidWhitespace/formatting shift triggering prettier complaintsThe fix preserves whitespace and formatting loosely; if the original JSX relied on precise formatting for prettier or linter compatibility, the insertion might shift indentation or line breaks in a wa

Sources

r1-p001 · Regex with escaped unicode flags and lastIndex mutation
1let pattern = /\u0068\u0072\u0065\u0066/g;
2pattern.lastIndex = 0;
3const html = '<a href="/url" target="_blank">click</a>';
4console.log('match:', pattern.exec(html));
match: [
  'href',
  index: 3,
  input: '<a href="/url" target="_blank">click</a>',
  groups: undefined
]
r1-p002 · Custom component renders <a> internally - fix applied to wrapper (generated program does not parse: /home/sun/dev/diaghunt/runs/2026-10-17T20-55-5)
1function Link({href, target}) {
2 return <a href={href} target={target}>click</a>;
3}
4const el = <Link href="/url" target="_blank" />;
5console.log('Component rendered');
r1-p003 · SSR context where injected rel affects extension behavior
1let ssrHtml = '<a href="/url" target="_blank" data-ext="track">link</a>';
2console.log('SSR HTML:', ssrHtml.includes('rel') ? 'has rel' : 'no rel');
SSR HTML: no rel
r1-p004 · allowDomains config leads to over-fix on allowed domain
1const allowed = ['trusted.com'];
2const url = 'https://trusted.com/path';
3if (allowed.some(d => url.includes(d))) {
4 console.log('Allowed domain, no fix needed');
5} else {
6 console.log('Fix would apply');
7}
Allowed domain, no fix needed
r1-p005 · ASI hazard: leading paren after semicolon-less statement
1let x = 1
2;(function(){
3 const html = '<a href="/url" target="_blank">test</a>';
4 console.log('ASI safe:', html);
5})()
ASI safe: <a href="/url" target="_blank">test</a>
r1-p006 · Fix applied to wrapper, actual anchor unprotected due to spread (generated program does not parse: /home/sun/dev/diaghunt/runs/2026-10-17T20-55-5)
1function SafeLink({target, rel, ...rest}) {
2 return <a {...rest} target={target} rel={rel}>link</a>;
3}
4const el = <SafeLink target="_blank" href="/url" />;
5console.log('Wrapper got rel?', !!el.target);
r1-p007 · Null/undefined distinction with optional chaining
1let obj = {attrs: null};
2let rel = obj?.attrs?.rel;
3console.log('rel is:', rel === null ? 'null' : rel === undefined ? 'undefined' : rel);
4if (!rel) {
5 console.log('Would add rel=noopener');
6}
rel is: undefined
Would add rel=noopener
r1-p008 · this binding: arrow vs function method extraction
1const linker = {
2 html: '<a href="/url" target="_blank">link</a>',
3 getHtml: function() { return this.html; }
4};
5const fn = linker.getHtml;
6console.log('Extracted fn:', fn());
r2-p001 · Template literal with spread props interfering with static rel insertion
1const relProp = 'nofollow'; const html = `<a href="/url" target="_blank" ${relProp ? `rel=\"${relProp}\"` : ''}>text</a>`; console.log(html);
<a href="/url" target="_blank" rel="nofollow">text</a>
r2-p002 · SVG namespace prefix treated as HTML anchor
1console.log('<svg:a target="_blank">link</svg:a>');
<svg:a target="_blank">link</svg:a>
r2-p003 · Rel token order changed affecting downstream parsing
1let relValue = 'external'; const el = document.createElement('a'); el.href = '/url'; el.target = '_blank'; el.rel = relValue; console.log(el.rel); // should be 'external', but fix makes it 'external noopener'
r2-p004 · Var hoisting and re-declaration in loop affecting rel handling
1for (var i = 0; i < 2; i++) { var rel = i === 0 ? 'nofollow' : undefined; const tag = `<a href="/url" target="_blank"${rel ? ` rel=\"${rel}\"` : ''}>${i}</a>`; console.log(tag); }
<a href="/url" target="_blank" rel="nofollow">0</a>
<a href="/url" target="_blank">1</a>
r2-p005 · Duplicate noopener added when already present in rel
1let relAttr = 'noopener noreferrer'; const a = document.createElement('a'); a.href = '#'; a.target = '_blank'; a.rel = relAttr; console.log(a.rel); // current: 'noopener noreferrer', after fix: 'noopener noreferrer noopener'
r2-p006 · Getter/setter side effects on rel attribute
1const obj = {}; let internalRel = ''; Object.defineProperty(obj, 'rel', { get() { return internalRel; }, set(v) { internalRel = v + '-set'; } }); obj.rel = 'nofollow'; console.log(obj.rel); // should be 'nofollow-set', but fix may interfere
nofollow-set
r2-p007 · JSX comment between target and closing bracket displaced by rel insertion (generated program does not parse: /home/sun/dev/diaghunt/runs/2026-10-17T20-55-5)
1const el = (<a href="/url" target="_blank" {/* debug */}>click</a>); console.log(el.props.children);
r2-p008 · Whitespace/formatting shift triggering prettier complaints (generated program does not parse: /home/sun/dev/diaghunt/runs/2026-10-17T20-55-5)
1const btn = (
2 <a
3 href="/url"
4 target="_blank"
5 className="btn"
6 >
7 submit
8 </a>
9); console.log(btn.type === 'a' && btn.props.target === '_blank');