Skip to content

Javascript cannot query specific getAMemberCall #13401

@ttttmr

Description

@ttttmr

Here is the sample code

let ele = document.createElement("div");
ele.addEventListener("click", (e) => {
  const params = {};
  for (const name of ele.getAttributeNames()) {
    params[name] = ele.getAttribute(name);
  }
});
document.documentElement.appendChild(ele);

Here is the query code

import javascript
import DataFlow::PathGraph

from DataFlow::SourceNode e
where e = DOM::documentRef().getAMemberCall("createElement")
select e

Can query ele, but try to query ele.getAttribute will not work

import javascript
import DataFlow::PathGraph

from DataFlow::SourceNode e
where e = DOM::documentRef().getAMemberCall("createElement")
select e,e.getAMemberCall("getAttribute")

Metadata

Metadata

Assignees

No one assigned

    Labels

    JSquestionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions