@@ -301,54 +301,51 @@ class HeaderDeclaration extends DataFlow::Node {
301301 * A data-flow node that sets a cookie in an HTTP response.
302302 *
303303 * Extend this class to refine existing API models. If you want to model new APIs,
304- * extend `HTTP::CookieWrite ::Range` instead.
304+ * extend `Cookie ::Range` instead.
305305 */
306- class CookieWrite extends DataFlow:: Node {
307- CookieWrite :: Range range ;
306+ class Cookie extends DataFlow:: Node {
307+ Cookie :: Range range ;
308308
309- CookieWrite ( ) { this = range }
309+ Cookie ( ) { this = range }
310310
311311 /**
312- * Gets the argument, if any, specifying the raw cookie header .
312+ * Holds if this cookie is secure .
313313 */
314- DataFlow :: Node getHeaderArg ( ) { result = range .getHeaderArg ( ) }
314+ predicate isSecure ( ) { range .isSecure ( ) }
315315
316316 /**
317- * Gets the argument, if any, specifying the cookie name .
317+ * Holds if this cookie is HttpOnly .
318318 */
319- DataFlow :: Node getNameArg ( ) { result = range .getNameArg ( ) }
319+ predicate isHttpOnly ( ) { range .isHttpOnly ( ) }
320320
321321 /**
322- * Gets the argument, if any, specifying the cookie value.
322+ * Holds if the cookie is SameSite
323323 */
324- DataFlow :: Node getValueArg ( ) { result = range .getValueArg ( ) }
324+ predicate isSameSite ( ) { range .isSameSite ( ) }
325325}
326326
327327/** Provides a class for modeling new cookie writes on HTTP responses. */
328- module CookieWrite {
328+ module Cookie {
329329 /**
330330 * A data-flow node that sets a cookie in an HTTP response.
331331 *
332- * Note: we don't require that this redirect must be sent to a client (a kind of
333- * "if a tree falls in a forest and nobody hears it" situation).
334- *
335332 * Extend this class to model new APIs. If you want to refine existing API models,
336- * extend `HttpResponse ` instead.
333+ * extend `Cookie ` instead.
337334 */
338335 abstract class Range extends DataFlow:: Node {
339336 /**
340- * Gets the argument, if any, specifying the raw cookie header .
337+ * Holds if this cookie is secure .
341338 */
342- abstract DataFlow :: Node getHeaderArg ( ) ;
339+ abstract predicate isSecure ( ) ;
343340
344341 /**
345- * Gets the argument, if any, specifying the cookie name .
342+ * Holds if this cookie is HttpOnly .
346343 */
347- abstract DataFlow :: Node getNameArg ( ) ;
344+ abstract predicate isHttpOnly ( ) ;
348345
349346 /**
350- * Gets the argument, if any, specifying the cookie value .
347+ * Holds if the cookie is SameSite .
351348 */
352- abstract DataFlow :: Node getValueArg ( ) ;
349+ abstract predicate isSameSite ( ) ;
353350 }
354351}
0 commit comments