Find, fix and prevent vulnerabilities in your code.
high severity
- Vulnerable module: aws-cdk-lib
- Introduced through: aws-cdk-lib@2.161.1
Detailed paths
-
Introduced through: @conduit/infra@kenyipp/realworld-nodejs-example-app-infra#3ea753165483dde2bde7fae7875ff890e8a9ac0b › aws-cdk-lib@2.161.1Remediation: Upgrade to aws-cdk-lib@2.187.0.
Overview
aws-cdk-lib is a Version 2 of the AWS Cloud Development Kit library
Affected versions of this package are vulnerable to Insertion of Sensitive Information into Log File via the DescribeCognitoUserPoolClient CDK API. A user with access to the account where logs for this user pool are stored, and read permissions on the associated lambda function logs, can see the secrets generated by other users' cognito.UserPoolClient constructs.
Note: After upgrading, applications must be redeployed with the feature flag @aws-cdk/cognito:logUserPoolClientSecretValue set to false to remediate this vulnerability.
Workaround
This vulnerability can be avoided by setting Logging.withDataHidden().
Remediation
Upgrade aws-cdk-lib to version 2.187.0 or higher.
References
medium severity
- Vulnerable module: inflight
- Introduced through: @aws/pdk@0.25.17
Detailed paths
-
Introduced through: @conduit/infra@kenyipp/realworld-nodejs-example-app-infra#3ea753165483dde2bde7fae7875ff890e8a9ac0b › @aws/pdk@0.25.17 › @pnpm/reviewing.dependencies-hierarchy@2.1.11 › @pnpm/lockfile-file@8.1.8 › @zkochan/rimraf@2.1.3 › rimraf@3.0.2 › glob@7.2.3 › inflight@1.0.6
Overview
Affected versions of this package are vulnerable to Missing Release of Resource after Effective Lifetime via the makeres function due to improperly deleting keys from the reqs object after execution of callbacks. This behavior causes the keys to remain in the reqs object, which leads to resource exhaustion.
Exploiting this vulnerability results in crashing the node process or in the application crash.
Note: This library is not maintained, and currently, there is no fix for this issue. To overcome this vulnerability, several dependent packages have eliminated the use of this library.
To trigger the memory leak, an attacker would need to have the ability to execute or influence the asynchronous operations that use the inflight module within the application. This typically requires access to the internal workings of the server or application, which is not commonly exposed to remote users. Therefore, “Attack vector” is marked as “Local”.
PoC
const inflight = require('inflight');
function testInflight() {
let i = 0;
function scheduleNext() {
let key = `key-${i++}`;
const callback = () => {
};
for (let j = 0; j < 1000000; j++) {
inflight(key, callback);
}
setImmediate(scheduleNext);
}
if (i % 100 === 0) {
console.log(process.memoryUsage());
}
scheduleNext();
}
testInflight();
Remediation
There is no fixed version for inflight.
References
medium severity
- Vulnerable module: aws-cdk-lib
- Introduced through: aws-cdk-lib@2.161.1
Detailed paths
-
Introduced through: @conduit/infra@kenyipp/realworld-nodejs-example-app-infra#3ea753165483dde2bde7fae7875ff890e8a9ac0b › aws-cdk-lib@2.161.1Remediation: Upgrade to aws-cdk-lib@2.184.0.
Overview
aws-cdk-lib is a Version 2 of the AWS Cloud Development Kit library
Affected versions of this package are vulnerable to Incorrect Default Permissions in the IAM trust policy. A user with sts:AssumeRole permissions can escalate privileges to those defined by the IAM trust policy, including performing unauthorized actions on CloudFormation, CodeCommit, Lambda, and ECS.
Note: After upgrading to the patched version, the feature flag @aws-cdk/pipelines:reduceStageRoleTrustScope must be set to true, and applications redeployed.
Remediation
Upgrade aws-cdk-lib to version 2.184.0 or higher.
References
low severity
- Vulnerable module: aws-cdk-lib
- Introduced through: aws-cdk-lib@2.161.1
Detailed paths
-
Introduced through: @conduit/infra@kenyipp/realworld-nodejs-example-app-infra#3ea753165483dde2bde7fae7875ff890e8a9ac0b › aws-cdk-lib@2.161.1Remediation: Upgrade to aws-cdk-lib@2.177.0.
Overview
aws-cdk-lib is a Version 2 of the AWS Cloud Development Kit library
Affected versions of this package are vulnerable to Improper Verification of Cryptographic Signature due to the tls.connect method setting rejectUnauthorized to false by default. An attacker can intercept and manipulate the data transmitted over the connection by exploiting the lack of proper TLS verification.ֿ
Note
The issuer URL is specified by CDK users when defining their CDK application. If they choose to connect to an unauthorized OIDC provider, CDK should not prevent this. Furthermore, the code block is executed within a Lambda environment, which helps mitigate the risk of MITM attacks.
After upgrading to the fixed version, ensure the feature flag
@aws-cdk/aws-iam:oidcRejectUnauthorizedConnectionsis set totrueincdk.context.jsonorcdk.json. More details on AWS CDK feature flags setting can be found here.
Remediation
Upgrade aws-cdk-lib to version 2.177.0 or higher.