Skip to content

fix: attribute key that is prefixed with / are not redacted when allAttributesPrivate is set to true#150

Merged
joker23 merged 1 commit into
mainfrom
szhang/fix-slash-prefixed-attribute-redaction-bypass
Jul 17, 2026
Merged

fix: attribute key that is prefixed with / are not redacted when allAttributesPrivate is set to true#150
joker23 merged 1 commit into
mainfrom
szhang/fix-slash-prefixed-attribute-redaction-bypass

Conversation

@joker23

@joker23 joker23 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Note

Low Risk
Small, targeted change to privacy redaction with new tests; fixes a data-leak bug without altering unrelated filtering paths.

Overview
When allAttributesPrivate is on or anonymous redaction applies, attribute names that literally start with / were not always stripped because getAttributesToFilter used raw Object.keys values while redaction compares attribute references (e.g. /ssn/~1ssn).

getAttributesToFilter now maps keys that start with / through AttributeReference.literalToReference, matching the behavior already used for legacy privateAttributeNames and for cloneExcluding. Legacy users (custom fields), single-kind contexts, and multi-kind sub-contexts all get the same fix.

Tests cover legacy custom fields, top-level slash keys, anonymous redaction, and multi-kind allAttributesPrivate cases.

Reviewed by Cursor Bugbot for commit cd7c6fa. Bugbot is set up for automated code reviews on this repo. Configure here.

@joker23

joker23 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit cd7c6fa. Configure here.

@joker23
joker23 marked this pull request as ready for review July 15, 2026 17:13
@joker23
joker23 requested a review from a team as a code owner July 15, 2026 17:13

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@keelerm84 keelerm84 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this showcase a gap in our contract tests? Can we make sure to expand that coverage as well?

@joker23

joker23 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Does this showcase a gap in our contract tests? Can we make sure to expand that coverage as well?

maybe, I can take a look at that, but I don't think the packages that uses this common module are contract tested.

@joker23
joker23 merged commit 8cd6b15 into main Jul 17, 2026
12 checks passed
@joker23
joker23 deleted the szhang/fix-slash-prefixed-attribute-redaction-bypass branch July 17, 2026 20:13
joker23 pushed a commit that referenced this pull request Jul 17, 2026
🤖 I have created a release *beep* *boop*
---


##
[5.8.2](5.8.1...5.8.2)
(2026-07-17)


### Bug Fixes

* attribute key that is prefixed with `/` are not redacted when
`allAttributesPrivate` is set to `true`
([#150](#150))
([8cd6b15](8cd6b15))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Metadata-only release bump with no code changes in the diff; risk is
limited to consumers picking up the published 5.8.2 artifact that
includes the prior privacy fix.
> 
> **Overview**
> **Release 5.8.2** — bumps `launchdarkly-js-sdk-common` from **5.8.1**
to **5.8.2** via Release Please (`.release-please-manifest.json`,
`package.json`) and adds the **5.8.2** section to `CHANGELOG.md`.
> 
> There is **no application source change** in this diff; it publishes a
patch that documents bug fix **#150**: with **`allAttributesPrivate:
true`**, context attribute keys that start with **`/`** are now redacted
correctly (they were previously left unredacted).
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
9321305. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants