File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
javascript/frameworks/cap/src/sensitive-exposure Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,25 @@ import advanced_security.javascript.frameworks.cap.CDS
1616import advanced_security.javascript.frameworks.cap.CAPLogInjectionQuery
1717import DataFlow:: PathGraph
1818
19+ /**
20+ * An entity instance obtained by the entity's namespace,
21+ * via `cds.entities`
22+ * ```javascript
23+ * // Obtained through `cds.entities`
24+ * const { Service1 } = cds.entities("sample.application.namespace");
25+ * ```
26+ */
27+ class EntityEntry extends DataFlow:: CallNode {
28+ EntityEntry ( ) { exists ( CdsEntitiesCall c | c .getACall ( ) = this ) }
29+
30+ /**
31+ * Gets the namespace that this entity belongs to.
32+ */
33+ string getNamespace ( ) {
34+ result = this .getArgument ( 0 ) .getALocalSource ( ) .asExpr ( ) .( StringLiteral ) .getValue ( )
35+ }
36+ }
37+
1938SourceNode entityAccesses ( TypeTracker t , string entityNamespace ) {
2039 t .start ( ) and
2140 exists ( EntityEntry e | result = e and entityNamespace = e .getNamespace ( ) )
You can’t perform that action at this time.
0 commit comments