Skip to content

[User profiles] Strict user profile setting keys#241213

Merged
legrego merged 18 commits into
elastic:mainfrom
SiddharthMantri:restrict-internal-user-profile-update-data
Dec 4, 2025
Merged

[User profiles] Strict user profile setting keys#241213
legrego merged 18 commits into
elastic:mainfrom
SiddharthMantri:restrict-internal-user-profile-update-data

Conversation

@SiddharthMantri
Copy link
Copy Markdown
Contributor

@SiddharthMantri SiddharthMantri commented Oct 29, 2025

Summary

Adds strict schema validation to the user profile update API endpoint (/internal/security/user_profile/_data) to restrict the request body to just allowed fields.

The PR also introduces some reasonable defaults for string length for colors and initials.

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Unit or functional tests were updated or added to match the most common scenarios
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines

@SiddharthMantri SiddharthMantri marked this pull request as ready for review November 7, 2025 12:43
@SiddharthMantri SiddharthMantri requested a review from a team as a code owner November 7, 2025 12:43
@SiddharthMantri SiddharthMantri added Team:Security Platform Security: Auth, Users, Roles, Spaces, Audit Logging, etc t// release_note:skip Skip the PR/issue when compiling release notes Feature:Security/User Profile labels Nov 7, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-security (Team:Security)

@SiddharthMantri
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

Comment on lines +78 to +83
// expect(() => bodySchema.validate(null)).toThrowErrorMatchingInlineSnapshot(
// `"expected a plain object value, but found [null] instead."`
// );
// expect(() => bodySchema.validate(undefined)).toThrowErrorMatchingInlineSnapshot(
// `"expected value of type [object] but got [undefined]"`
// );
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Commenting these out as for some reason null and undefined are now accepted and the endpoint schema validation does not throw.

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.

Should we remove these or uncomment?

Also how the route is supposed to react to such requests?

solutionNavOptOut: schema.maybe(schema.boolean()),
})
),
});
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Related to https://github.com/elastic/kibana/pull/241213/files#r2503396102

We could add special validation logic here to disallow falsy values.

@SiddharthMantri SiddharthMantri requested a review from a team as a code owner November 7, 2025 15:40
@SiddharthMantri
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

Comment on lines +30 to +33
schema.object({
initials: schema.nullable(schema.string({ maxLength: MAX_STRING_FIELD_LENGTH })),
color: schema.nullable(schema.string({ maxLength: MAX_STRING_FIELD_LENGTH })),
imageUrl: schema.nullable(schema.string()),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've added some defaults for maxLength for these fields.

@azasypkin (tagging you since i saw you assigned to the review 😅) - I'm not sure how to approach restricting imageUrl length.

@SiddharthMantri
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@azasypkin
Copy link
Copy Markdown
Contributor

ACK: I'll review PR today

Copy link
Copy Markdown
Contributor

@azasypkin azasypkin left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! Just one question/suggestion.

Also, do we need to update this interface as well

export interface UserSettingsData {
darkMode?: DarkModeValue;
contrastMode?: ContrastModeValue;
solutionNavOptOut?: boolean;
}
?

'solutionNavigationTour:completed', // TODO: remove with https://github.com/elastic/kibana/issues/239313
];

const MAX_STRING_FIELD_LENGTH = 1024;
Copy link
Copy Markdown
Contributor

@azasypkin azasypkin Dec 2, 2025

Choose a reason for hiding this comment

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

question/suggestion: Is there any particular reason or use case why we want to support 1024 characters for initials and color instead of, let's say, 100? We can technically go even lower and align with the limits in UI, but I don't have a strong opinion.

If we have a user that has anything in the user profile that's larger than these limits, nothing would break except they'll have to obey the new limits if they decide to update the data, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If we have a user that has anything in the user profile that's larger than these limits, nothing would break except they'll have to obey the new limits if they decide to update the data, right?

That's right. It shouldn't affect any existing data since it's just validation on save.

No particular reason for 1024. Matching the UI limits fromm the form field works for me too.

avatar: schema.maybe(
schema.object({
initials: schema.nullable(schema.string({ maxLength: MAX_STRING_FIELD_LENGTH })),
color: schema.nullable(schema.string({ maxLength: MAX_STRING_FIELD_LENGTH })),
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.

note: not really related to this PR as it was like that before, just observation, it looks like we're too aggressive in enforcing a valid avatar color to a degree that one cannot even access their profile to fix the issue (just bypassed UI restriction via dev tools and saved invalid color) 🤦

Image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Interesting, i hadn't come across this. I'll create an issue for us to look into.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Issue created: #245085

@SiddharthMantri SiddharthMantri added the backport:all-open Backport to all branches that could still receive a release label Dec 2, 2025
@SiddharthMantri
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@SiddharthMantri
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

@legrego legrego merged commit 90fdc5f into elastic:main Dec 4, 2025
12 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.19, 9.1, 9.2

https://github.com/elastic/kibana/actions/runs/19934479447

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 4, 2025
## Summary

Adds strict schema validation to the user profile update API endpoint
(/internal/security/user_profile/_data) to restrict the request body to
just allowed fields.

The PR also introduces some reasonable defaults for string length for
colors and initials.

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 90fdc5f)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 4, 2025
## Summary

Adds strict schema validation to the user profile update API endpoint
(/internal/security/user_profile/_data) to restrict the request body to
just allowed fields.

The PR also introduces some reasonable defaults for string length for
colors and initials.

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 90fdc5f)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 4, 2025
## Summary

Adds strict schema validation to the user profile update API endpoint
(/internal/security/user_profile/_data) to restrict the request body to
just allowed fields.

The PR also introduces some reasonable defaults for string length for
colors and initials.

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 90fdc5f)
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
8.19
9.1
9.2

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Dec 4, 2025
…5267)

# Backport

This will backport the following commits from `main` to `9.2`:
- [[User profiles] Strict user profile setting keys
(#241213)](#241213)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT
[{"author":{"name":"Sid","email":"siddharthmantri1@gmail.com"},"sourceCommit":{"committedDate":"2025-12-04T15:33:51Z","message":"[User
profiles] Strict user profile setting keys (#241213)\n\n##
Summary\n\nAdds strict schema validation to the user profile update API
endpoint\n(/internal/security/user_profile/_data) to restrict the
request body to\njust allowed fields.\n\nThe PR also introduces some
reasonable defaults for string length for\ncolors and initials.\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"90fdc5f8bbbb90640c08d531c3c52556ec324ec7","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Security","release_note:skip","Feature:Security/User
Profile","backport:all-open","v9.3.0"],"title":"[User profiles] Strict
user profile setting
keys","number":241213,"url":"https://github.com/elastic/kibana/pull/241213","mergeCommit":{"message":"[User
profiles] Strict user profile setting keys (#241213)\n\n##
Summary\n\nAdds strict schema validation to the user profile update API
endpoint\n(/internal/security/user_profile/_data) to restrict the
request body to\njust allowed fields.\n\nThe PR also introduces some
reasonable defaults for string length for\ncolors and initials.\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"90fdc5f8bbbb90640c08d531c3c52556ec324ec7"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/241213","number":241213,"mergeCommit":{"message":"[User
profiles] Strict user profile setting keys (#241213)\n\n##
Summary\n\nAdds strict schema validation to the user profile update API
endpoint\n(/internal/security/user_profile/_data) to restrict the
request body to\njust allowed fields.\n\nThe PR also introduces some
reasonable defaults for string length for\ncolors and initials.\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"90fdc5f8bbbb90640c08d531c3c52556ec324ec7"}}]}]
BACKPORT-->

Co-authored-by: Sid <siddharthmantri1@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
kibanamachine added a commit that referenced this pull request Dec 4, 2025
…5266)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[User profiles] Strict user profile setting keys
(#241213)](#241213)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT
[{"author":{"name":"Sid","email":"siddharthmantri1@gmail.com"},"sourceCommit":{"committedDate":"2025-12-04T15:33:51Z","message":"[User
profiles] Strict user profile setting keys (#241213)\n\n##
Summary\n\nAdds strict schema validation to the user profile update API
endpoint\n(/internal/security/user_profile/_data) to restrict the
request body to\njust allowed fields.\n\nThe PR also introduces some
reasonable defaults for string length for\ncolors and initials.\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"90fdc5f8bbbb90640c08d531c3c52556ec324ec7","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Security","release_note:skip","Feature:Security/User
Profile","backport:all-open","v9.3.0"],"title":"[User profiles] Strict
user profile setting
keys","number":241213,"url":"https://github.com/elastic/kibana/pull/241213","mergeCommit":{"message":"[User
profiles] Strict user profile setting keys (#241213)\n\n##
Summary\n\nAdds strict schema validation to the user profile update API
endpoint\n(/internal/security/user_profile/_data) to restrict the
request body to\njust allowed fields.\n\nThe PR also introduces some
reasonable defaults for string length for\ncolors and initials.\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"90fdc5f8bbbb90640c08d531c3c52556ec324ec7"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/241213","number":241213,"mergeCommit":{"message":"[User
profiles] Strict user profile setting keys (#241213)\n\n##
Summary\n\nAdds strict schema validation to the user profile update API
endpoint\n(/internal/security/user_profile/_data) to restrict the
request body to\njust allowed fields.\n\nThe PR also introduces some
reasonable defaults for string length for\ncolors and initials.\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"90fdc5f8bbbb90640c08d531c3c52556ec324ec7"}}]}]
BACKPORT-->

Co-authored-by: Sid <siddharthmantri1@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@kibanamachine kibanamachine added v9.1.9 backport missing Added to PRs automatically when the are determined to be missing a backport. labels Dec 4, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @SiddharthMantri

kibanamachine added a commit that referenced this pull request Dec 5, 2025
…45265)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[User profiles] Strict user profile setting keys
(#241213)](#241213)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT
[{"author":{"name":"Sid","email":"siddharthmantri1@gmail.com"},"sourceCommit":{"committedDate":"2025-12-04T15:33:51Z","message":"[User
profiles] Strict user profile setting keys (#241213)\n\n##
Summary\n\nAdds strict schema validation to the user profile update API
endpoint\n(/internal/security/user_profile/_data) to restrict the
request body to\njust allowed fields.\n\nThe PR also introduces some
reasonable defaults for string length for\ncolors and initials.\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"90fdc5f8bbbb90640c08d531c3c52556ec324ec7","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Security","release_note:skip","Feature:Security/User
Profile","backport:all-open","v9.3.0"],"title":"[User profiles] Strict
user profile setting
keys","number":241213,"url":"https://github.com/elastic/kibana/pull/241213","mergeCommit":{"message":"[User
profiles] Strict user profile setting keys (#241213)\n\n##
Summary\n\nAdds strict schema validation to the user profile update API
endpoint\n(/internal/security/user_profile/_data) to restrict the
request body to\njust allowed fields.\n\nThe PR also introduces some
reasonable defaults for string length for\ncolors and initials.\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"90fdc5f8bbbb90640c08d531c3c52556ec324ec7"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/241213","number":241213,"mergeCommit":{"message":"[User
profiles] Strict user profile setting keys (#241213)\n\n##
Summary\n\nAdds strict schema validation to the user profile update API
endpoint\n(/internal/security/user_profile/_data) to restrict the
request body to\njust allowed fields.\n\nThe PR also introduces some
reasonable defaults for string length for\ncolors and initials.\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"90fdc5f8bbbb90640c08d531c3c52556ec324ec7"}}]}]
BACKPORT-->

Co-authored-by: Sid <siddharthmantri1@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@kibanamachine kibanamachine added v8.19.9 and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Dec 5, 2025
JordanSh pushed a commit to JordanSh/kibana that referenced this pull request Dec 9, 2025
## Summary

Adds strict schema validation to the user profile update API endpoint
(/internal/security/user_profile/_data) to restrict the request body to
just allowed fields.

The PR also introduces some reasonable defaults for string length for
colors and initials.

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:all-open Backport to all branches that could still receive a release Feature:Security/User Profile release_note:skip Skip the PR/issue when compiling release notes Team:Security Platform Security: Auth, Users, Roles, Spaces, Audit Logging, etc t// v8.19.9 v9.1.9 v9.2.3 v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UserProfiles] Consider making UserProfileData allowlist more discoverable via strict types

6 participants