Skip to content

Fix text attachment MIME misclassification#3628

Merged
shakkernerd merged 2 commits intoopenclaw:mainfrom
frankekn:fix/media-text-attachments
Jan 29, 2026
Merged

Fix text attachment MIME misclassification#3628
shakkernerd merged 2 commits intoopenclaw:mainfrom
frankekn:fix/media-text-attachments

Conversation

@frankekn
Copy link
Copy Markdown
Contributor

Summary

  • preserve inbound Telegram original filenames when saving media to keep correct extensions
  • add text-file extraction for inbound attachments with CSV/TSV inference and UTF-16/UTF-8 heuristics
  • treat text-like attachments misdetected as audio as text for media understanding

Testing

  • not run (manual repro with Telegram CSV/TSV attachments)

@openclaw-barnacle openclaw-barnacle bot added the channel: telegram Channel integration: telegram label Jan 28, 2026
@frankekn
Copy link
Copy Markdown
Contributor Author

Test update:

  • Full pnpm test run started via a temporary pnpm shim; timed out after 120s and hit failures in session-memory hook tests due to missing Anthropic API key/auth profiles.
  • Targeted unit run passed: corepack pnpm vitest run --config vitest.unit.config.ts src/media-understanding/apply.test.ts

@shakkernerd shakkernerd merged commit cb18ce7 into openclaw:main Jan 29, 2026
19 of 23 checks passed
shakkernerd added a commit that referenced this pull request Jan 29, 2026
…3628)

- Fix CSV/TSV inference from content heuristics
- Add UTF-16 detection and BOM handling
- Add XML attribute escaping for file output (security)
- Add MIME override logging for auditability
- Add comprehensive test coverage for edge cases

Thanks @frankekn
shakkernerd added a commit that referenced this pull request Jan 29, 2026
* fix: Prevent XML attribute injection by escaping special characters in file name and MIME type attributes.

* fix: text attachment MIME misclassification with security hardening (#3628)

- Fix CSV/TSV inference from content heuristics
- Add UTF-16 detection and BOM handling
- Add XML attribute escaping for file output (security)
- Add MIME override logging for auditability
- Add comprehensive test coverage for edge cases

Thanks @frankekn
HirokiKobayashi-R pushed a commit to HirokiKobayashi-R/moltbot that referenced this pull request Jan 29, 2026
* Fix text file attachment detection

* Add file attachment extraction tests
HirokiKobayashi-R pushed a commit to HirokiKobayashi-R/moltbot that referenced this pull request Jan 29, 2026
* fix: Prevent XML attribute injection by escaping special characters in file name and MIME type attributes.

* fix: text attachment MIME misclassification with security hardening (openclaw#3628)

- Fix CSV/TSV inference from content heuristics
- Add UTF-16 detection and BOM handling
- Add XML attribute escaping for file output (security)
- Add MIME override logging for auditability
- Add comprehensive test coverage for edge cases

Thanks @frankekn
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Jan 31, 2026
* Fix text file attachment detection

* Add file attachment extraction tests
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Jan 31, 2026
* fix: Prevent XML attribute injection by escaping special characters in file name and MIME type attributes.

* fix: text attachment MIME misclassification with security hardening (openclaw#3628)

- Fix CSV/TSV inference from content heuristics
- Add UTF-16 detection and BOM handling
- Add XML attribute escaping for file output (security)
- Add MIME override logging for auditability
- Add comprehensive test coverage for edge cases

Thanks @frankekn
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Jan 31, 2026
* Fix text file attachment detection

* Add file attachment extraction tests
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Jan 31, 2026
* fix: Prevent XML attribute injection by escaping special characters in file name and MIME type attributes.

* fix: text attachment MIME misclassification with security hardening (openclaw#3628)

- Fix CSV/TSV inference from content heuristics
- Add UTF-16 detection and BOM handling
- Add XML attribute escaping for file output (security)
- Add MIME override logging for auditability
- Add comprehensive test coverage for edge cases

Thanks @frankekn
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Jan 31, 2026
* Fix text file attachment detection

* Add file attachment extraction tests
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Jan 31, 2026
* fix: Prevent XML attribute injection by escaping special characters in file name and MIME type attributes.

* fix: text attachment MIME misclassification with security hardening (openclaw#3628)

- Fix CSV/TSV inference from content heuristics
- Add UTF-16 detection and BOM handling
- Add XML attribute escaping for file output (security)
- Add MIME override logging for auditability
- Add comprehensive test coverage for edge cases

Thanks @frankekn
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Jan 31, 2026
* Fix text file attachment detection

* Add file attachment extraction tests
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Jan 31, 2026
* fix: Prevent XML attribute injection by escaping special characters in file name and MIME type attributes.

* fix: text attachment MIME misclassification with security hardening (openclaw#3628)

- Fix CSV/TSV inference from content heuristics
- Add UTF-16 detection and BOM handling
- Add XML attribute escaping for file output (security)
- Add MIME override logging for auditability
- Add comprehensive test coverage for edge cases

Thanks @frankekn
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Jan 31, 2026
* Fix text file attachment detection

* Add file attachment extraction tests
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Jan 31, 2026
* fix: Prevent XML attribute injection by escaping special characters in file name and MIME type attributes.

* fix: text attachment MIME misclassification with security hardening (openclaw#3628)

- Fix CSV/TSV inference from content heuristics
- Add UTF-16 detection and BOM handling
- Add XML attribute escaping for file output (security)
- Add MIME override logging for auditability
- Add comprehensive test coverage for edge cases

Thanks @frankekn
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Jan 31, 2026
* Fix text file attachment detection

* Add file attachment extraction tests
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Jan 31, 2026
* fix: Prevent XML attribute injection by escaping special characters in file name and MIME type attributes.

* fix: text attachment MIME misclassification with security hardening (openclaw#3628)

- Fix CSV/TSV inference from content heuristics
- Add UTF-16 detection and BOM handling
- Add XML attribute escaping for file output (security)
- Add MIME override logging for auditability
- Add comprehensive test coverage for edge cases

Thanks @frankekn
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Jan 31, 2026
* Fix text file attachment detection

* Add file attachment extraction tests
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Jan 31, 2026
* fix: Prevent XML attribute injection by escaping special characters in file name and MIME type attributes.

* fix: text attachment MIME misclassification with security hardening (openclaw#3628)

- Fix CSV/TSV inference from content heuristics
- Add UTF-16 detection and BOM handling
- Add XML attribute escaping for file output (security)
- Add MIME override logging for auditability
- Add comprehensive test coverage for edge cases

Thanks @frankekn
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Jan 31, 2026
* Fix text file attachment detection

* Add file attachment extraction tests
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Jan 31, 2026
* fix: Prevent XML attribute injection by escaping special characters in file name and MIME type attributes.

* fix: text attachment MIME misclassification with security hardening (openclaw#3628)

- Fix CSV/TSV inference from content heuristics
- Add UTF-16 detection and BOM handling
- Add XML attribute escaping for file output (security)
- Add MIME override logging for auditability
- Add comprehensive test coverage for edge cases

Thanks @frankekn
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Jan 31, 2026
* Fix text file attachment detection

* Add file attachment extraction tests
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Jan 31, 2026
* fix: Prevent XML attribute injection by escaping special characters in file name and MIME type attributes.

* fix: text attachment MIME misclassification with security hardening (openclaw#3628)

- Fix CSV/TSV inference from content heuristics
- Add UTF-16 detection and BOM handling
- Add XML attribute escaping for file output (security)
- Add MIME override logging for auditability
- Add comprehensive test coverage for edge cases

Thanks @frankekn
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Feb 1, 2026
* Fix text file attachment detection

* Add file attachment extraction tests
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Feb 1, 2026
* fix: Prevent XML attribute injection by escaping special characters in file name and MIME type attributes.

* fix: text attachment MIME misclassification with security hardening (openclaw#3628)

- Fix CSV/TSV inference from content heuristics
- Add UTF-16 detection and BOM handling
- Add XML attribute escaping for file output (security)
- Add MIME override logging for auditability
- Add comprehensive test coverage for edge cases

Thanks @frankekn
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Feb 1, 2026
* Fix text file attachment detection

* Add file attachment extraction tests
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Feb 1, 2026
* fix: Prevent XML attribute injection by escaping special characters in file name and MIME type attributes.

* fix: text attachment MIME misclassification with security hardening (openclaw#3628)

- Fix CSV/TSV inference from content heuristics
- Add UTF-16 detection and BOM handling
- Add XML attribute escaping for file output (security)
- Add MIME override logging for auditability
- Add comprehensive test coverage for edge cases

Thanks @frankekn
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Feb 1, 2026
* Fix text file attachment detection

* Add file attachment extraction tests
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Feb 1, 2026
* fix: Prevent XML attribute injection by escaping special characters in file name and MIME type attributes.

* fix: text attachment MIME misclassification with security hardening (openclaw#3628)

- Fix CSV/TSV inference from content heuristics
- Add UTF-16 detection and BOM handling
- Add XML attribute escaping for file output (security)
- Add MIME override logging for auditability
- Add comprehensive test coverage for edge cases

Thanks @frankekn
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Feb 1, 2026
* Fix text file attachment detection

* Add file attachment extraction tests
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Feb 1, 2026
* fix: Prevent XML attribute injection by escaping special characters in file name and MIME type attributes.

* fix: text attachment MIME misclassification with security hardening (openclaw#3628)

- Fix CSV/TSV inference from content heuristics
- Add UTF-16 detection and BOM handling
- Add XML attribute escaping for file output (security)
- Add MIME override logging for auditability
- Add comprehensive test coverage for edge cases

Thanks @frankekn
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Feb 1, 2026
* Fix text file attachment detection

* Add file attachment extraction tests
YuriNachos pushed a commit to YuriNachos/clawdbot-fork that referenced this pull request Feb 1, 2026
* fix: Prevent XML attribute injection by escaping special characters in file name and MIME type attributes.

* fix: text attachment MIME misclassification with security hardening (openclaw#3628)

- Fix CSV/TSV inference from content heuristics
- Add UTF-16 detection and BOM handling
- Add XML attribute escaping for file output (security)
- Add MIME override logging for auditability
- Add comprehensive test coverage for edge cases

Thanks @frankekn
uxcu pushed a commit to uxcu/kook-openclaw that referenced this pull request Feb 5, 2026
* Fix text file attachment detection

* Add file attachment extraction tests
uxcu pushed a commit to uxcu/kook-openclaw that referenced this pull request Feb 5, 2026
* fix: Prevent XML attribute injection by escaping special characters in file name and MIME type attributes.

* fix: text attachment MIME misclassification with security hardening (openclaw#3628)

- Fix CSV/TSV inference from content heuristics
- Add UTF-16 detection and BOM handling
- Add XML attribute escaping for file output (security)
- Add MIME override logging for auditability
- Add comprehensive test coverage for edge cases

Thanks @frankekn
bestNiu pushed a commit to bestNiu/clawdbot that referenced this pull request Feb 5, 2026
* Fix text file attachment detection

* Add file attachment extraction tests
bestNiu pushed a commit to bestNiu/clawdbot that referenced this pull request Feb 5, 2026
* fix: Prevent XML attribute injection by escaping special characters in file name and MIME type attributes.

* fix: text attachment MIME misclassification with security hardening (openclaw#3628)

- Fix CSV/TSV inference from content heuristics
- Add UTF-16 detection and BOM handling
- Add XML attribute escaping for file output (security)
- Add MIME override logging for auditability
- Add comprehensive test coverage for edge cases

Thanks @frankekn
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
* Fix text file attachment detection

* Add file attachment extraction tests
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
* fix: Prevent XML attribute injection by escaping special characters in file name and MIME type attributes.

* fix: text attachment MIME misclassification with security hardening (openclaw#3628)

- Fix CSV/TSV inference from content heuristics
- Add UTF-16 detection and BOM handling
- Add XML attribute escaping for file output (security)
- Add MIME override logging for auditability
- Add comprehensive test coverage for edge cases

Thanks @frankekn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants