Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add content for rule guidance containing "TO DO"s. #617

Merged
merged 37 commits into from
Jun 7, 2024
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d13094a
Add guidance for weak random rule
danfiedler-msft May 24, 2024
23a94f3
Add guidance for outdated TLS protocol
danfiedler-msft May 24, 2024
718bf40
Add guidance for XXE rule
danfiedler-msft May 24, 2024
67e873f
Add guidance for weak cipher mode rule
danfiedler-msft May 28, 2024
7850ce8
Point disabled cert validation rules at complete guidance
danfiedler-msft May 28, 2024
f851727
Add guidance for DPAPI entropy rule
danfiedler-msft May 28, 2024
efd8ddf
Use existing HTTPS guidance for Ruby rule
danfiedler-msft May 29, 2024
b72a2ed
Add guidance for strncat rule
danfiedler-msft May 29, 2024
a44c7eb
Add guidance for strncpy rule
danfiedler-msft May 29, 2024
2e2c338
Add guidance for 3DES rule
danfiedler-msft May 30, 2024
21c7ce0
Add guidance for C gets rule
danfiedler-msft May 31, 2024
0901152
Add guidance for C strcat rule
danfiedler-msft May 31, 2024
0955a3e
Add guidance for C strcpy rule
danfiedler-msft May 31, 2024
a1b5853
Add guidance for C malloc rule
danfiedler-msft May 31, 2024
bf7e8fa
Add guidance for banned C function rule
danfiedler-msft May 31, 2024
514bf59
Add guidance for InitializeSecurityContext rule
danfiedler-msft May 31, 2024
fd93736
Add guidance for PowerShell restricted function rule
danfiedler-msft May 31, 2024
86d68fc
Add guidance for NOT implementing MD5/SHA1 rule
danfiedler-msft May 31, 2024
62cbd83
Add guidance for objective-c format string rule
danfiedler-msft Jun 3, 2024
eb0ae5d
Add guidance for memcpy rule
danfiedler-msft Jun 3, 2024
e1b0f43
Point C++ TLS version rule to existing guidance
danfiedler-msft Jun 3, 2024
4f5f0b1
Point .NET outdated SSL rule to general guidance
danfiedler-msft Jun 3, 2024
aa0a02b
Add guidance for seeding RNG with time rule
danfiedler-msft Jun 5, 2024
98b5e80
Add guidance for mcrypt rules
danfiedler-msft Jun 5, 2024
79b1949
Add guidance for debug rule
danfiedler-msft Jun 5, 2024
51da320
Add guidance for iOS uniqueIdentifier rule
danfiedler-msft Jun 5, 2024
bae1b01
Add guidance for obj-c xss rule
danfiedler-msft Jun 5, 2024
1e22ee6
Add guidance for eval XSS rule
danfiedler-msft Jun 5, 2024
6e22ea4
Add guidance for hardcoded secret rule
danfiedler-msft Jun 5, 2024
bda40e9
Add guidance for C FILE copy rule
danfiedler-msft Jun 5, 2024
f00b7d8
Add guidance for PHP file include rule
danfiedler-msft Jun 5, 2024
c0332bd
Add guidance for ASPNET Controller rule
danfiedler-msft Jun 5, 2024
f6d6799
Add guidance for iOS NSUserDefaults rule
danfiedler-msft Jun 5, 2024
34c6344
Add guidance for hashing time rule
danfiedler-msft Jun 5, 2024
325a66c
Remove optional encryption rule (applies to unknown tech?)
danfiedler-msft Jun 5, 2024
63939ab
Add test condition that guidance must have content
danfiedler-msft Jun 5, 2024
bcb7522
Update changelog for guidance changes
danfiedler-msft Jun 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add guidance for C strcpy rule
  • Loading branch information
danfiedler-msft committed May 31, 2024
commit 0955a3e5ee5446d26a8bd58acaa3265cc8528131
2 changes: 1 addition & 1 deletion guidance/DS141863.md
Original file line number Diff line number Diff line change
@@ -24,4 +24,4 @@ In the worst case, a buffer overrun vulnerability can provide an attacker the ab
* [CodeQL: Potentially unsafe call to strcat](https://codeql.github.com/codeql-query-help/cpp/cpp-unsafe-strcat/)
* [Microsoft Learn: strcat_s](https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/strcat-s-wcscat-s-mbscat-s?view=msvc-170)
* [Avoiding Buffer Overruns](https://learn.microsoft.com/en-us/windows/win32/SecBP/avoiding-buffer-overruns)
* [OWASP: Buffer Overflow](https://owasp.org/www-community/vulnerabilities/Buffer_Overflow)
* [OWASP: Buffer Overflow](https://owasp.org/www-community/vulnerabilities/Buffer_Overflow)
29 changes: 22 additions & 7 deletions guidance/DS185832.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
## Banned C function detected (strcpy)
# Banned C function detected (strcpy)

### Summary
strcpy is frequently dangerous, as it will cause a buffer overflow if the source is larger than the destination.
## Summary

### Details
TO DO - put more details of problem and solution here
* Use of the `strcpy` function to copy a string can lead to a buffer overrun vulnerability.
* Use secure versions such as `strcpy_s` to help prevent buffer overruns.

### Severity Considerations
TO DO - put more details on the severity of the issue here. Generally how big of a problem is this, and what makes it more or less of a problem?
## Details

The `strcpy` function does not check for sufficient space in the destination buffer.
This is a potential cause of a buffer overrun vulnerability.
A buffer overflow will occur if the source is larger than the destination.

## Solution

Use secure versions such as `strcpy_s` to help prevent buffer overruns.

## Severity Considerations

In the worst case, a buffer overrun vulnerability can provide an attacker the ability to execute arbitrary code leading to complete system compromise.

## References

* [Microsoft Learn: strcpy_s](https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/strcpy-s-wcscpy-s-mbscpy-s?view=msvc-170)
* [Avoiding Buffer Overruns](https://learn.microsoft.com/en-us/windows/win32/SecBP/avoiding-buffer-overruns)
* [OWASP: Buffer Overflow](https://owasp.org/www-community/vulnerabilities/Buffer_Overflow)