Skip to content

CP: extra error message checks and correct escaping in error message (#50136) - #50140

Merged
MagnusHJensen merged 1 commit into
rc-minor-fleet-v4.90.0from
cp-50136
Jul 29, 2026
Merged

CP: extra error message checks and correct escaping in error message (#50136)#50140
MagnusHJensen merged 1 commit into
rc-minor-fleet-v4.90.0from
cp-50136

Conversation

@MagnusHJensen

Copy link
Copy Markdown
Member

Related issue: Resolves #40074 unreleased bug

Cherry picks: #50136

Checklist for submitter

If some of the following don't apply, delete the relevant line.

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.
    See Changes
    files
    for more information.

  • Input data is properly validated, SELECT * is avoided, SQL injection is prevented (using placeholders for values in statements), JS inline code is prevented especially for url redirects, and untrusted data interpolated into shell scripts/commands is validated against shell metacharacters.

  • Timeouts are implemented and retries are limited to avoid infinite loops

  • If paths of existing endpoints are modified without backwards compatibility, checked the frontend/CLI for any necessary changes

Testing

  • Added/updated automated tests
  • QA'd all new/changed functionality manually

Summary by CodeRabbit

  • Bug Fixes
  • Improved configuration profile validation for unescaped special characters in Apple payloads.
  • Error messages now consistently indicate when characters like & and < must be XML-escaped.
    • Updated error examples to show properly escaped guidance.
  • Expanded test coverage to verify the standardized XML-escaping error for additional failing scenarios.

)

<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #40074 unreleased bug

<img width="539" height="141" alt="image"
src="https://github.com/user-attachments/assets/1ac8e2c2-236d-4567-a200-0eb35cce46e7"
/>


# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [ ] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

- [ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements), JS
inline code is prevented especially for url redirects, and untrusted
data interpolated into shell scripts/commands is validated against shell
metacharacters.
- [ ] Timeouts are implemented and retries are limited to avoid infinite
loops
- [ ] If paths of existing endpoints are modified without backwards
compatibility, checked the frontend/CLI for any necessary changes

## Testing

- [x] Added/updated automated tests
- [x] QA'd all new/changed functionality manually

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Improved configuration profile validation for unescaped special
characters in Apple payloads.
* Error messages now consistently indicate when characters like `&` and
`<` must be XML-escaped.
  * Updated error examples to show properly escaped guidance.
* Expanded test coverage to verify the standardized XML-escaping error
for additional failing scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@MagnusHJensen
MagnusHJensen requested a review from a team as a code owner July 29, 2026 13:01
@MagnusHJensen
MagnusHJensen merged commit 0c12a48 into rc-minor-fleet-v4.90.0 Jul 29, 2026
26 checks passed
@MagnusHJensen
MagnusHJensen deleted the cp-50136 branch July 29, 2026 13:17
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (rc-minor-fleet-v4.90.0@ebeec8a). Learn more about missing BASE report.

Files with missing lines Patch % Lines
server/mdm/apple/mobileconfig/mobileconfig.go 50.00% 2 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##             rc-minor-fleet-v4.90.0   #50140   +/-   ##
=========================================================
  Coverage                          ?   67.89%           
=========================================================
  Files                             ?     3890           
  Lines                             ?   248288           
  Branches                          ?    12967           
=========================================================
  Hits                              ?   168575           
  Misses                            ?    64498           
  Partials                          ?    15215           
Flag Coverage Δ
backend 69.30% <50.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants