Skip to content

Commit 8a3d1fe

Browse files
committed
Ruby: add CookieSecurityConfigurationSetting concept
1 parent b80a84c commit 8a3d1fe

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

ruby/ql/lib/codeql/ruby/Concepts.qll

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,3 +644,34 @@ module Path {
644644
abstract class Range extends DataFlow::Node { }
645645
}
646646
}
647+
648+
/**
649+
* A data-flow node that may configure behaviour relating to cookie security.
650+
*
651+
* Extend this class to refine existing API models. If you want to model new APIs,
652+
* extend `CookieSecurityConfigurationSetting::Range` instead.
653+
*/
654+
class CookieSecurityConfigurationSetting extends DataFlow::Node instanceof CookieSecurityConfigurationSetting::Range {
655+
/**
656+
* Gets a description of how this cookie setting may weaken application security.
657+
* This predicate has no results if the setting is considered to be safe.
658+
*/
659+
string getSecurityWarningMessage() { result = super.getSecurityWarningMessage() }
660+
}
661+
662+
/** Provides a class for modeling new cookie security setting APIs. */
663+
module CookieSecurityConfigurationSetting {
664+
/**
665+
* A data-flow node that may configure behaviour relating to cookie security.
666+
*
667+
* Extend this class to model new APIs. If you want to refine existing API models,
668+
* extend `CookieSecurityConfigurationSetting` instead.
669+
*/
670+
abstract class Range extends DataFlow::Node {
671+
/**
672+
* Gets a description of how this cookie setting may weaken application security.
673+
* This predicate has no results if the setting is considered to be safe.
674+
*/
675+
abstract string getSecurityWarningMessage();
676+
}
677+
}

0 commit comments

Comments
 (0)