)]}'
{
  "commit": "c05e17bb3b2dca130fc919668a96b4bec9eb9442",
  "tree": "04ff3b2029564ba5aef3931b25f74712f4f86578",
  "parents": [
    "d864b10871cd4370fe574816b489c819c675ccc7"
  ],
  "author": {
    "name": "Filippo Valsorda",
    "email": "filippo@golang.org",
    "time": "Tue Apr 23 15:32:34 2019 -0400"
  },
  "committer": {
    "name": "Filippo Valsorda",
    "email": "filippo@golang.org",
    "time": "Wed Apr 24 20:35:55 2019 +0000"
  },
  "message": "openpgp/clearsign: reject potentially misleading headers and messages\n\nAida Mynzhasova of SEC Consult Vulnerability Lab reported that the\nclearsign package accepts some malformed messages, which can make it\npossible for an attacker to trick a human user (but not a Go program)\ninto thinking unverified text is part of the message.\n\nFor example, if in the following message the vertical tab character is\nprinted as a new line, a human observer could believe that the\nunverified header text is part of the signed message.\n\n-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\\x0b\\x0bThis text is part of the header.\n\nHello world!\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.4.10 (GNU/Linux)\n\niJwEAQECAAYFAk8kMuEACgkQO9o98PRieSpMsAQAhmY/vwmNpflrPgmfWsYhk5O8\n[...]\nMyTpno24AjIAGb+mH1U\u003d\n\u003dhIJ6\n-----END PGP SIGNATURE-----\n\nThe OpenPGP specs are delightfully vague about purpose and validation of\nthese headers. RFC 4880, Section 7 says\n\n    The cleartext signed message consists of:\n\n        - The cleartext header \u0027-----BEGIN PGP SIGNED MESSAGE-----\u0027 on a\n        single line,\n\n        - One or more \"Hash\" Armor Headers,\n\n        - Exactly one empty line not included into the message digest,\n        [...]\n\nbut also\n\n    If MD5 is the only hash used, then an\n    implementation MAY omit this header for improved V2.x compatibility.\n\nand\n\n    If more than one message digest is used in the signature, the \"Hash\"\n    armor header contains a comma-delimited list of used message digests.\n\nwhich seems to suggest that there can be zero or more Hash headers, each\nwith one or more algorithms, and no other header types.\n\nAnyway, it\u0027s entirely unclear what security purpose, if any, the Hash\nheader accomplishes. If the hash is too weak to be secure or\nunsupported, the verification will fail. Otherwise, the user shouldn\u0027t\ncare. Given its dubious function, avoid breaking abstractions to check\nthat it matches the signature, and just document it as unverified.\n\nAs for valid characters, RFC 4880 is silent, except reluctantly\nmentioning that the Comment header can be UTF-8, but I am going to\nassume that all hash algorithms will have ASCII names, because come on.\n\nEven more importantly, reject non-Hash SIGNED MESSAGE headers (as opposed\nto the SIGNATURE headers), to prevent a \"Thank you!\" message turning into\n\n-----BEGIN PGP SIGNED MESSAGE-----\nReminder: I need you to wire $100k to 12345566 as soon as possible.\n\nThank you!\n-----BEGIN PGP SIGNATURE-----\n[...]\n\nWhile at it, also check for trailing characters after the signed message\ndelimiter, as they are invalid and can be similarly used to confuse humans.\n\nThe Decode API is also unfortunate in that it doesn\u0027t return an error,\nso we can\u0027t tell the user what\u0027s wrong with the message, but that\u0027s what\nwe\u0027ve got.\n\nChange-Id: I8a72c4851075337443d7a27e0b49a6b6e39f5a41\nReviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/453011\nReviewed-by: Adam Langley \u003cagl@google.com\u003e\nReviewed-on: https://go-review.googlesource.com/c/crypto/+/173778\nRun-TryBot: Filippo Valsorda \u003cfilippo@golang.org\u003e\nReviewed-by: Adam Langley \u003cagl@golang.org\u003e\nTryBot-Result: Gobot Gobot \u003cgobot@golang.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "a9437dc16845ba888c26a6fa57642a70764d3362",
      "old_mode": 33188,
      "old_path": "openpgp/clearsign/clearsign.go",
      "new_id": "c36046021935941d3aba0712419309cddd492c70",
      "new_mode": 33188,
      "new_path": "openpgp/clearsign/clearsign.go"
    },
    {
      "type": "modify",
      "old_id": "96f5d7818ba549734b10e84e0f0a66bfdd8a6652",
      "old_mode": 33188,
      "old_path": "openpgp/clearsign/clearsign_test.go",
      "new_id": "737f41fc4685e1239bc26194bd2122bf54ab70ae",
      "new_mode": 33188,
      "new_path": "openpgp/clearsign/clearsign_test.go"
    }
  ]
}
