Skip to content

fix(certificatemanager): apexDomain returns incorrect results for domains colliding with Object.prototype#37329

Closed
syukawa-gh wants to merge 3 commits intoaws:mainfrom
syukawa-gh:fix/acm-apex-domain-prototype-clean
Closed

fix(certificatemanager): apexDomain returns incorrect results for domains colliding with Object.prototype#37329
syukawa-gh wants to merge 3 commits intoaws:mainfrom
syukawa-gh:fix/acm-apex-domain-prototype-clean

Conversation

@syukawa-gh
Copy link
Copy Markdown
Contributor

The apexDomain utility used the in operator which checks the entire prototype chain. Domains containing segments like toString or valueOf would incorrectly match Object.prototype properties, resulting in an incorrect apex domain.

Replaced with Object.hasOwn() to only check own properties of the publicSuffixes object.

Closes #37193

…omains colliding with Object.prototype

The apexDomain utility used the `in` operator which checks the
entire prototype chain. Domains containing segments like 'toString'
or 'valueOf' would incorrectly match Object.prototype properties.
Replaced with Object.hasOwn() to only check own properties.

Closes aws#37193
@github-actions github-actions bot added bug This issue is a bug. beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/small Small work item – less than a day of effort p1 labels Mar 23, 2026
@aws-cdk-automation aws-cdk-automation requested a review from a team March 23, 2026 10:14
Copy link
Copy Markdown
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This review is outdated)

@syukawa-gh
Copy link
Copy Markdown
Contributor Author

Exemption Request: This PR fixes a logic bug in a utility function. Unit test has been added. Integration test is not applicable as apexDomain is an internal utility function not directly tied to CloudFormation resource generation.

@aws-cdk-automation aws-cdk-automation added the pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. label Mar 24, 2026
@aws-cdk-automation aws-cdk-automation dismissed their stale review March 24, 2026 02:14

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@aws-cdk-automation aws-cdk-automation added the pr/needs-further-review PR requires additional review from our team specialists due to the scope or complexity of changes. label Mar 24, 2026
@syukawa-gh
Copy link
Copy Markdown
Contributor Author

Closing in favor of #37477 (same change, updated version)

@syukawa-gh syukawa-gh closed this Apr 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. effort/small Small work item – less than a day of effort p1 pr/needs-further-review PR requires additional review from our team specialists due to the scope or complexity of changes. pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(aws-certificatemanager): apexDomain utility returns incorrect results for domains colliding with Object.prototype methods

3 participants