Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

How can I differentiate a tampered signed cookie from a `false` JSON cookie?

オープン
#168 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
活発
技術スタック
javascript, node.js
領域
backend

調査の方向性

まず、署名付きCookieとJSON Cookieについてのcookie-parserドキュメントを確認し、次に、有効な署名付きj:プレフィックス付きfalse値と、失敗した署名との衝突を再現します。現在のAPIがそれらを区別するのに十分な情報を公開しているかを判断し、その結果を文書化するか、必要な動作とその検証ケースを定義してください。

索引モデルが issue の本文から書いたものです。

説明

question

Forewarning: I am extremely new to Node.js and NPM.

From reading the documentation of cookieParser, it appears that cookies that are signed but fail validation are assigned false in the req.signedCookies object.

Signed cookies that fail signature validation will have the value false instead of the tampered value.

Also, cookies prefixed with j: are automatically parsed with JSON.parse.

In addition, this module supports special "JSON cookies". These are cookie where the value is prefixed with j:. When these values are encountered, the value will be exposed as the result of JSON.parse.

However, the string 'false' is valid JSON, so it should get parsed to false. I also found no option to disable the built-in JSON parser. How can I differentiate a valid signed j:'false' cookie from an invalid signed cookie?

If this is not possible, I request that this be relabeled to a bug report or feature request.

主要言語
JavaScript
スター
2k
フォーク
235
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

expressjs/cookie-parser のほかの issue

expressjs/cookie-parser の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。