{
  "schema_version": "1.1.0",
  "record_type": "citation-evidence-pack",
  "pack_id": "s3-presigned-url-debugger",
  "title": "S3 presigned PUT signature examples",
  "description": "Compare one matching presigned PUT with method and Content-Type mismatches using the same synthetic URL, public example key, and fixed reference time.",
  "scope": "This synthetic PUT variation uses AWS's public example credentials and a fixed 2013 reference time. The comparisons check signature bytes; they do not send requests or test AWS permissions. The historical URL is expired today.",
  "canonical_url": "https://encrypt-online.com/evidence/s3-presigned-url-debugger.json",
  "tool": {
    "id": "s3-presigned-url-debugger",
    "name": "S3 Presigned URL Debugger",
    "path": "/tools/s3-presigned-url-debugger",
    "canonical_url": "https://encrypt-online.com/tools/s3-presigned-url-debugger"
  },
  "implementation": {
    "version": "source-sha256:c607eae36380eb28",
    "aggregate_sha256": "c607eae36380eb280fea0f320f906932d5e528c4acee86b56a0b4ac6ecfc6ef2",
    "sources": [
      {
        "path": "package-lock.json",
        "sha256": "fb25cd404f41ef1f4e0d22bbb4cd7b0ff858db7700351dfd27d79138d8661f58"
      },
      {
        "path": "lib/aws-sigv4-core.mjs",
        "sha256": "cd9110f0a2c530fd98285901236a884411787d23d21a63206472efaf21fdd146"
      },
      {
        "path": "data/aws-citation-evidence.mjs",
        "sha256": "2440346949657d772a9fc2b08d263a6bfc94114c211f51da2d6bd21625006c98"
      },
      {
        "path": "scripts/aws-citation-evidence-adapters.mjs",
        "sha256": "a3f9673ebb53001c058dbc73d8afdb2b841158494772cff112832390d55de20d"
      },
      {
        "path": "scripts/check-aws-citation-evidence.mjs",
        "sha256": "29eef53beed7767630db0b5c74f13113676db82902f93a78c97438469d8104cb"
      }
    ]
  },
  "verification": {
    "last_verified": "2026-10-20",
    "command": "npm run check:citation-evidence",
    "environments": [
      "Node.js release check with Web Crypto",
      "Chromium desktop 1440x900 evidence presentation"
    ]
  },
  "standards": [
    {
      "name": "AWS S3 SigV4 query authentication",
      "section": "Canonical query, SignedHeaders, UNSIGNED-PAYLOAD, and expiration",
      "url": "https://docs.aws.amazon.com/AmazonS3/latest/developerguide/sigv4-query-string-auth.html"
    },
    {
      "name": "AWS SigV4 troubleshooting",
      "section": "Canonical request and signing string errors",
      "url": "https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-troubleshooting.html"
    }
  ],
  "cases": [
    {
      "case_id": "S3-PRESIGNED-PUT-MATCH-001",
      "classification": "valid",
      "symptom": "The supplied PUT method and text/plain Content-Type reproduce the signature in this synthetic upload URL.",
      "safe_input": {
        "url": "https://examplebucket.s3.amazonaws.com/test.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20130524%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20130524T000000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Signature=3283ea304eace967b5bac32c10643da28a8e29777fefaa542771984238c2c7f3",
        "method": "PUT",
        "headers": "Content-Type: text/plain",
        "secretKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
        "now": "2013-05-24T00:30:00Z"
      },
      "expected_output": {
        "status": "match",
        "method": "PUT",
        "signed_headers": "content-type;host",
        "canonical_request": "PUT\n/test.txt\nX-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20130524%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20130524T000000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=content-type%3Bhost\ncontent-type:text/plain\nhost:examplebucket.s3.amazonaws.com\n\ncontent-type;host\nUNSIGNED-PAYLOAD",
        "canonical_request_sha256": "318a67227b7b8d346087eec66ccf270bbfbc7cb5131402ff94b55e07755b84eb",
        "string_to_sign": "AWS4-HMAC-SHA256\n20130524T000000Z\n20130524/us-east-1/s3/aws4_request\n318a67227b7b8d346087eec66ccf270bbfbc7cb5131402ff94b55e07755b84eb",
        "calculated_signature": "3283ea304eace967b5bac32c10643da28a8e29777fefaa542771984238c2c7f3",
        "supplied_signature": "3283ea304eace967b5bac32c10643da28a8e29777fefaa542771984238c2c7f3",
        "signature_matches": true,
        "requested_expires_at": "2013-05-24T01:00:00.000Z",
        "remaining_seconds": 1800
      },
      "failure_code": null,
      "expected_outcome": "The calculated signature equals the URL signature. At the fixed reference time, 1,800 seconds remain in the requested lifetime.",
      "fixture_sha256": "a13ef37a08c8d3f3d5f297c1509042ca888793a94db1ec6b82b1b494febf266c",
      "example": {
        "title": "Matching PUT request",
        "steps": [
          "Paste this synthetic presigned URL and choose PUT as the Request method.",
          "Open Request headers, time, and signing key. Enter Content-Type: text/plain and the public example secret below.",
          "Set Reference time in UTC to May 24, 2013 at 00:30:00 so the historical example is checked within its original hour.",
          "Select Check URL. The signature matches; compare the canonical request and both signatures below."
        ],
        "values": [
          {
            "label": "Presigned URL",
            "value": "https://examplebucket.s3.amazonaws.com/test.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20130524%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20130524T000000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Signature=3283ea304eace967b5bac32c10643da28a8e29777fefaa542771984238c2c7f3"
          },
          {
            "label": "Request method",
            "value": "PUT"
          },
          {
            "label": "Request headers",
            "value": "Content-Type: text/plain"
          },
          {
            "label": "Reference time (UTC)",
            "value": "2013-05-24T00:30:00Z"
          },
          {
            "label": "Public AWS example secret",
            "value": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
          },
          {
            "label": "Canonical request",
            "value": "PUT\n/test.txt\nX-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20130524%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20130524T000000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=content-type%3Bhost\ncontent-type:text/plain\nhost:examplebucket.s3.amazonaws.com\n\ncontent-type;host\nUNSIGNED-PAYLOAD"
          },
          {
            "label": "Signature in the URL",
            "value": "3283ea304eace967b5bac32c10643da28a8e29777fefaa542771984238c2c7f3"
          },
          {
            "label": "Calculated signature",
            "value": "3283ea304eace967b5bac32c10643da28a8e29777fefaa542771984238c2c7f3"
          }
        ]
      }
    },
    {
      "case_id": "S3-PRESIGNED-METHOD-MISMATCH-002",
      "classification": "mismatch",
      "symptom": "Choosing GET for the same URL changes the calculated signature even though its query parameters are unchanged.",
      "safe_input": {
        "url": "https://examplebucket.s3.amazonaws.com/test.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20130524%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20130524T000000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Signature=3283ea304eace967b5bac32c10643da28a8e29777fefaa542771984238c2c7f3",
        "method": "GET",
        "headers": "Content-Type: text/plain",
        "secretKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
        "now": "2013-05-24T00:30:00Z"
      },
      "expected_output": {
        "status": "mismatch",
        "method": "GET",
        "signed_headers": "content-type;host",
        "canonical_request": "GET\n/test.txt\nX-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20130524%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20130524T000000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=content-type%3Bhost\ncontent-type:text/plain\nhost:examplebucket.s3.amazonaws.com\n\ncontent-type;host\nUNSIGNED-PAYLOAD",
        "canonical_request_sha256": "caad9d9a76370ca1c9c126a4f832200eff31836562ae7bcb23f4f67143fa4245",
        "string_to_sign": "AWS4-HMAC-SHA256\n20130524T000000Z\n20130524/us-east-1/s3/aws4_request\ncaad9d9a76370ca1c9c126a4f832200eff31836562ae7bcb23f4f67143fa4245",
        "calculated_signature": "1415fd73752d790a55ee5ad5af3c82e02906afa3797dc27d5b9d6bc68b916ee6",
        "supplied_signature": "3283ea304eace967b5bac32c10643da28a8e29777fefaa542771984238c2c7f3",
        "signature_matches": false,
        "requested_expires_at": "2013-05-24T01:00:00.000Z",
        "remaining_seconds": 1800
      },
      "failure_code": "SIGNATURE_MISMATCH",
      "expected_outcome": "Use PUT for this upload URL. The HTTP method is signed even though the URL does not contain a method parameter.",
      "fixture_sha256": "fb8fef275692d405883eaec0e54ee75303e98be460a122c4f90dffcfd605bc9a",
      "example": {
        "title": "GET with a URL signed for PUT",
        "steps": [
          "Paste the same synthetic URL, then choose GET instead of PUT.",
          "Keep Content-Type: text/plain, the public example secret, and Reference time in UTC at May 24, 2013 at 00:30:00.",
          "Select Check URL. The first canonical request line is now GET, and its calculated signature differs from the URL signature.",
          "Change only Request method back to PUT and check again to restore the match."
        ],
        "values": [
          {
            "label": "Presigned URL",
            "value": "https://examplebucket.s3.amazonaws.com/test.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20130524%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20130524T000000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Signature=3283ea304eace967b5bac32c10643da28a8e29777fefaa542771984238c2c7f3"
          },
          {
            "label": "Request method",
            "value": "GET"
          },
          {
            "label": "Request headers",
            "value": "Content-Type: text/plain"
          },
          {
            "label": "Reference time (UTC)",
            "value": "2013-05-24T00:30:00Z"
          },
          {
            "label": "Public AWS example secret",
            "value": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
          },
          {
            "label": "Canonical request",
            "value": "GET\n/test.txt\nX-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20130524%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20130524T000000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=content-type%3Bhost\ncontent-type:text/plain\nhost:examplebucket.s3.amazonaws.com\n\ncontent-type;host\nUNSIGNED-PAYLOAD"
          },
          {
            "label": "Signature in the URL",
            "value": "3283ea304eace967b5bac32c10643da28a8e29777fefaa542771984238c2c7f3"
          },
          {
            "label": "Calculated signature",
            "value": "1415fd73752d790a55ee5ad5af3c82e02906afa3797dc27d5b9d6bc68b916ee6"
          }
        ]
      }
    },
    {
      "case_id": "S3-PRESIGNED-CONTENT-TYPE-MISMATCH-003",
      "classification": "mismatch",
      "symptom": "Changing the signed Content-Type from text/plain to application/json changes the signature for the same PUT URL.",
      "safe_input": {
        "url": "https://examplebucket.s3.amazonaws.com/test.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20130524%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20130524T000000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Signature=3283ea304eace967b5bac32c10643da28a8e29777fefaa542771984238c2c7f3",
        "method": "PUT",
        "headers": "Content-Type: application/json",
        "secretKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
        "now": "2013-05-24T00:30:00Z"
      },
      "expected_output": {
        "status": "mismatch",
        "method": "PUT",
        "signed_headers": "content-type;host",
        "canonical_request": "PUT\n/test.txt\nX-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20130524%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20130524T000000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=content-type%3Bhost\ncontent-type:application/json\nhost:examplebucket.s3.amazonaws.com\n\ncontent-type;host\nUNSIGNED-PAYLOAD",
        "canonical_request_sha256": "bd66379b3f4484f37af6af6fecad66a1f3839a611793f26ea9209b733c7b8c0d",
        "string_to_sign": "AWS4-HMAC-SHA256\n20130524T000000Z\n20130524/us-east-1/s3/aws4_request\nbd66379b3f4484f37af6af6fecad66a1f3839a611793f26ea9209b733c7b8c0d",
        "calculated_signature": "42be1cff50d54fec5ca261e8386253c900e568175b869eee72afff9602b2c101",
        "supplied_signature": "3283ea304eace967b5bac32c10643da28a8e29777fefaa542771984238c2c7f3",
        "signature_matches": false,
        "requested_expires_at": "2013-05-24T01:00:00.000Z",
        "remaining_seconds": 1800
      },
      "failure_code": "SIGNATURE_MISMATCH",
      "expected_outcome": "Send the Content-Type used by the signer, or generate a new URL for the intended type. This URL signs text/plain.",
      "fixture_sha256": "68eee32bc0c3d30174798f1bb4e330d4be229351f02c69970ccfb55f7eac1e1d",
      "example": {
        "title": "A different Content-Type",
        "steps": [
          "Paste the same synthetic URL, choose PUT, and enter Content-Type: application/json in Request headers.",
          "Keep the public example secret and Reference time in UTC at May 24, 2013 at 00:30:00.",
          "Select Check URL. The canonical Content-Type value and calculated signature now differ from the matching upload example.",
          "Change only the header value back to text/plain and check again to restore the match."
        ],
        "values": [
          {
            "label": "Presigned URL",
            "value": "https://examplebucket.s3.amazonaws.com/test.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20130524%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20130524T000000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Signature=3283ea304eace967b5bac32c10643da28a8e29777fefaa542771984238c2c7f3"
          },
          {
            "label": "Request method",
            "value": "PUT"
          },
          {
            "label": "Request headers",
            "value": "Content-Type: application/json"
          },
          {
            "label": "Reference time (UTC)",
            "value": "2013-05-24T00:30:00Z"
          },
          {
            "label": "Public AWS example secret",
            "value": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
          },
          {
            "label": "Canonical request",
            "value": "PUT\n/test.txt\nX-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20130524%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20130524T000000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=content-type%3Bhost\ncontent-type:application/json\nhost:examplebucket.s3.amazonaws.com\n\ncontent-type;host\nUNSIGNED-PAYLOAD"
          },
          {
            "label": "Signature in the URL",
            "value": "3283ea304eace967b5bac32c10643da28a8e29777fefaa542771984238c2c7f3"
          },
          {
            "label": "Calculated signature",
            "value": "42be1cff50d54fec5ca261e8386253c900e568175b869eee72afff9602b2c101"
          }
        ]
      }
    }
  ]
}
