Skip to content

Commit b127e6f

Browse files
committed
Add security section
1 parent e3d8cdd commit b127e6f

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ PHP Curl Class is an object-oriented wrapper of the PHP cURL extension that make
1313
- [Requirements](#requirements)
1414
- [Quick Start and Examples](#quick-start-and-examples)
1515
- [Available Methods](#available-methods)
16+
- [Security](#security)
1617
- [Contribute](#contribute)
1718

1819
---
@@ -279,6 +280,10 @@ MultiCurl::unsetHeader($key)
279280
MultiCurl::verbose($on = true, $output = STDERR)
280281
```
281282

283+
### Security
284+
285+
See [SECURITY.md](https://github.com/php-curl-class/php-curl-class/blob/master/SECURITY.md).
286+
282287
### Contribute
283288
1. Check for open issues or open a new issue to start a discussion around a bug or feature.
284289
1. Fork the repository on GitHub to start making your changes.

SECURITY.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Security
2+
3+
* Don't blindly accept arbitrary urls. Curl supports many protocols including `FILE`. The following would show the contents of `file:///etc/passwd`.
4+
5+
```php
6+
// https://www.example.com/fetch_page.php?url=file%3A%2F%2F%2Fetc%2Fpasswd
7+
$unsafe_url = $_GET['url']; // DANGER!
8+
$curl = new Curl();
9+
$curl->get($unsafe_url);
10+
echo $curl->response;
11+
```

0 commit comments

Comments
 (0)