aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.72k stars 3.94k forks source link

(custom-resources): ResponseURL visible in StepFunctions state #21224

Open rix0rrr opened 2 years ago

rix0rrr commented 2 years ago

Describe the bug

The ResponseURL is visible in the execution state of the StepFunctions state machine, and could be used by an attacker who is able to list the executions to falsify the custom resource result. Security has deemed this a medium priority security issue that needs attention.


Solution

Niggly details


While we're at it, might as well get rid of passing ResponseURL to user handlers based on a feature flag.

Expected Behavior

See above.

Current Behavior

See above.

Reproduction Steps

See above.

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

-

Framework Version

No response

Node.js Version

-

OS

-

Language

Typescript, Python, .NET, Java, Go

Language Version

No response

Other information

No response

arewa commented 2 years ago

Hi @rix0rrr, I would like to work on this issue, but could you give some examples of execution outputs with ResponseURL? I looked through my StepFunctions executions and cannot find ResponseURL nowhere. Maybe I am looking at wrong place. For example this is typical output of one of the steps (I truncated the payload):

{
  "ExecutedVersion": "$LATEST",
  "Payload": {
   ...
  },
  "SdkHttpMetadata": {
    "AllHttpHeaders": {
      "X-Amz-Executed-Version": [
        "$LATEST"
      ],
      "x-amzn-Remapped-Content-Length": [
        "0"
      ],
      "Connection": [
        "keep-alive"
      ],
      "x-amzn-RequestId": [
        "d65b9a69-6e74-44c5-afae-fd55785c8815"
      ],
      "Content-Length": [
        "79337"
      ],
      "Date": [
        "Mon, 27 Jun 2022 04:28:59 GMT"
      ],
      "X-Amzn-Trace-Id": [
        "root=1-62b93204-6892d9f421e0569a2d807036;sampled=0"
      ],
      "Content-Type": [
        "application/json"
      ]
    },
    "HttpHeaders": {
      "Connection": "keep-alive",
      "Content-Length": "79337",
      "Content-Type": "application/json",
      "Date": "Mon, 27 Jun 2022 04:28:59 GMT",
      "X-Amz-Executed-Version": "$LATEST",
      "x-amzn-Remapped-Content-Length": "0",
      "x-amzn-RequestId": "d65b9a69-6e74-44c5-afae-fd55785c8815",
      "X-Amzn-Trace-Id": "root=1-62b93204-6892d9f421e0569a2d807036;sampled=0"
    },
    "HttpStatusCode": 200
  },
  "SdkResponseMetadata": {
    "RequestId": "d65b9a69-6e74-44c5-afae-fd55785c8815"
  },
  "StatusCode": 200
}

Or probably you mean the following link?

image