-
Notifications
You must be signed in to change notification settings - Fork 31
DART-260 Modify rule S5332: Add Dart language #5109
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
Merged
antonioaversa
merged 2 commits into
master
from
antonio/DART-260-S5332-add-dart-language
Jun 11, 2025
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"securityStandards": { | ||
"CWE": [ | ||
200, | ||
319 | ||
], | ||
"OWASP": [ | ||
"A3" | ||
], | ||
"OWASP Mobile": [ | ||
"M3" | ||
], | ||
"OWASP Mobile Top 10 2024": [ | ||
"M5" | ||
], | ||
"MASVS": [ | ||
"MSTG-NETWORK-1" | ||
], | ||
"OWASP Top 10 2021": [ | ||
"A2" | ||
], | ||
"PCI DSS 3.2": [ | ||
"4.1", | ||
"6.5.4" | ||
], | ||
"PCI DSS 4.0": [ | ||
"4.2.1", | ||
"6.2.4" | ||
], | ||
"ASVS 4.0": [ | ||
"1.9.1", | ||
"9.1.1", | ||
"9.2.2" | ||
], | ||
"STIG ASD_V5R3": [ | ||
"V-222397", | ||
"V-222534", | ||
"V-222562", | ||
"V-222563", | ||
"V-222577", | ||
"V-222596", | ||
"V-222597", | ||
"V-222598", | ||
"V-222599" | ||
] | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
include::../description.adoc[] | ||
|
||
include::../ask-yourself.adoc[] | ||
|
||
include::../recommended.adoc[] | ||
|
||
== Sensitive Code Example | ||
|
||
Using `Uri.parse` from `dart:core`: | ||
|
||
[source,dart,diff-id=1,diff-type=noncompliant] | ||
---- | ||
void main() { | ||
Uri.parse( | ||
'http://vulnerable.com', // Sensitive | ||
); | ||
} | ||
---- | ||
|
||
Using `Dio` from `package:dio`: | ||
|
||
[source,dart,diff-id=2,diff-type=noncompliant] | ||
---- | ||
import 'package:dio/dio.dart'; | ||
|
||
void main() { | ||
final dio = Dio(); | ||
dio.get('http://vulnerable.com/api'); // Sensitive | ||
} | ||
---- | ||
|
||
Using `InAppWebViewSettings` from `package:flutter_inappwebview`: | ||
|
||
[source,dart,diff-id=3,diff-type=noncompliant] | ||
---- | ||
import 'package:flutter_inappwebview/flutter_inappwebview.dart'; | ||
|
||
void main() { | ||
InAppWebViewSettings( | ||
mixedContentMode: MixedContentMode.MIXED_CONTENT_ALWAYS_ALLOW, // Sensitive | ||
); | ||
} | ||
---- | ||
|
||
=== Compliant Solution | ||
|
||
Using `Uri.parse` from `dart:core`: | ||
|
||
[source,dart,diff-id=1,diff-type=compliant] | ||
---- | ||
void main() { | ||
Uri.parse( | ||
'https://secure.example.com', | ||
); | ||
} | ||
---- | ||
|
||
Using `Dio` from `package:dio`: | ||
|
||
[source,dart,diff-id=2,diff-type=compliant] | ||
---- | ||
import 'package:dio/dio.dart'; | ||
|
||
void main() { | ||
final dio = Dio(); | ||
dio.get('https://secure.example.com/api'); | ||
} | ||
---- | ||
|
||
Using `InAppWebViewSettings` from `package:flutter_inappwebview`: | ||
|
||
[source,dart,diff-id=3,diff-type=compliant] | ||
---- | ||
import 'package:flutter_inappwebview/flutter_inappwebview.dart'; | ||
|
||
void main() { | ||
InAppWebViewSettings( | ||
mixedContentMode: MixedContentMode.MIXED_CONTENT_NEVER_ALLOW, | ||
); | ||
} | ||
---- | ||
|
||
include::../exceptions.adoc[] | ||
|
||
== See | ||
|
||
include::../common/resources/documentation.adoc[] | ||
|
||
* Flutter API Docs - https://api.flutter.dev/flutter/dart-core/Uri-class.html[Uri class] | ||
* package:dio Docs - https://pub.dev/documentation/dio/latest/dio/Dio-class.html[Dio class] | ||
* package:dio Docs - https://pub.dev/documentation/dio/latest/dio/BaseOptions-class.html[BaseOptions class] | ||
* package:dio Docs - https://pub.dev/documentation/dio/latest/dio/RequestOptions-class.html[RequestOptions class] | ||
* package:flutter_inappwebview Docs - https://pub.dev/documentation/flutter_inappwebview/latest/flutter_inappwebview/InAppWebViewSettings-class.html[InAppWebViewSettings class] | ||
|
||
include::../common/resources/articles.adoc[] | ||
|
||
include::../common/resources/standards-mobile.adoc[] |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.