Visitar URL original
JS: How to mark the value of a property · Issue #5969 · github/codeql · GitHub
The Wayback Machine - https://web.archive.org/web/20260602224507/https://github.com/github/codeql/issues/5969
Skip to content

JS: How to mark the value of a property #5969

@fan-14

Description

@fan-14

The Ajax method accepts a key-pair value group, and I wish to set S in URL :s[n.view] as sink。wuu.....,I can't find way to mark the s。

image

I can find "url:s" by the property method but I don't know how to work further

import javascript
from ObjectExpr oe, Property p1
where
    p1 = oe.getProperty(0) 
    and
    p1.getName()="url"
    
select p1

Rough tracking doesn't get any inflow

import javascript

class Method_fingerprint extends TaintTracking::Configuration {
  Method_fingerprint() { this = "fingerprint" }

  override predicate isSource(DataFlow::Node source) {     
    any()
}

  override predicate isSink(DataFlow::Node sink) {
    exists(DataFlow::CallNode call |
        call.getCalleeName() = "ajax" 
        and
        sink = call.getArgument(0)
      )
  }
}
from Method_fingerprint pt, DataFlow::Node source, DataFlow::Node sink
where pt.hasFlow(source, sink)
select source, sink

The test JavaScript file is shown below
test.md

I'm truly grateful for any help.
thanks!!

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