From ee60f8e6c6eb6002b37d2b7d2c1c681c6c5cef13 Mon Sep 17 00:00:00 2001 From: Kristen Newbury Date: Thu, 23 Oct 2025 09:57:10 -0400 Subject: [PATCH] Update javascript/ql/lib/semmle/javascript/frameworks/React.qll Co-authored-by: Asger F --- .../ql/lib/semmle/javascript/frameworks/React.qll | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/frameworks/React.qll b/javascript/ql/lib/semmle/javascript/frameworks/React.qll index c68b6846a5b..1c321ae1c12 100644 --- a/javascript/ql/lib/semmle/javascript/frameworks/React.qll +++ b/javascript/ql/lib/semmle/javascript/frameworks/React.qll @@ -806,10 +806,12 @@ private class ReactRouterLocationSource extends DOM::LocationSource::Range { private class UseRefDomValueSource extends DOM::DomValueSource::Range { UseRefDomValueSource() { - exists(DataFlow::PropRead current, UseRefStep step | current = this | - step.step(_, current) and - current.mayHavePropertyName("current") - ) + this = + any(JsxAttribute attrib | attrib.getName() = "ref") + .getValue() + .flow() + .getALocalSource() + .getAPropertyRead("current") } }