-
Notifications
You must be signed in to change notification settings - Fork 1.7k
docs: Add untrusted data security warnings to System.Speech APIs #12149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add untrusted-data-instance-note to APIs that handle external XML/SRGS/SSML/audio files to warn developers about security risks when processing untrusted data. Changes: - SrgsDocument: Added class-level warning and warnings to constructors that accept file paths and XmlReader - Grammar: Added warnings to constructors that accept file paths and streams - PromptBuilder: Added warnings to AppendSsml(XmlReader) and AppendAudio(string) methods - GrammarBuilder: Added warnings to AppendRuleReference methods that accept file paths These APIs can load and parse external files which may contain corrupted or malicious content. The warnings direct developers to validate all inputs per OWASP guidelines.
|
@dotnet-policy-service agree company="Microsoft" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds security warnings to System.Speech APIs that handle external data sources (XML, SRGS, SSML, and audio files) to alert developers about potential security risks when processing untrusted data.
Key changes:
- Added
untrusted-data-instance-noteinclude directives to constructors and methods that accept file paths, streams, or XmlReader objects - Applied warnings consistently across four XML documentation files covering speech recognition and synthesis APIs
- Class-level and method-level warnings added to ensure comprehensive security guidance
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| xml/System.Speech.Synthesis/PromptBuilder.xml | Added security warnings to AppendAudio(string) and AppendSsml(XmlReader) methods |
| xml/System.Speech.Recognition/GrammarBuilder.xml | Added security warnings to both AppendRuleReference method overloads that accept file paths |
| xml/System.Speech.Recognition/Grammar.xml | Added security warnings to four constructors that accept file paths or streams |
| xml/System.Speech.Recognition.SrgsGrammar/SrgsDocument.xml | Added class-level security warning and warnings to constructors that accept file paths or XmlReader |
| <remarks> | ||
| <format type="text/markdown"><] |
Copilot
AI
Dec 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The include file reference should be untrusted-data-instance-note instead of untrusted-data-class-note to maintain consistency with the other warnings added in this PR. All other locations correctly use untrusted-data-instance-note.
| [!INCLUDE [untrusted-data-class-note](~/includes/untrusted-data-class-note.md)] | |
| [!INCLUDE [untrusted-data-instance-note](~/includes/untrusted-data-instance-note.md)] |
Add untrusted-data-instance-note to APIs that handle external XML/SRGS/SSML/audio files to warn developers about security risks when processing untrusted data.
Changes:
These APIs can load and parse external files which may contain corrupted or malicious content. The warnings direct developers to validate all inputs per OWASP guidelines.
Summary
Describe your changes here.
Fixes #Issue_Number (if available)