Selaa lähdekoodia

Merge pull request #1118 from Alkarex/API-input-sanitize

API limit INPUT to 1MB
Alexandre Alapetite 10 vuotta sitten
vanhempi
commit
90117b0397
2 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  1. 1 0
      CHANGELOG.md
  2. 1 1
      p/api/greader.php

+ 1 - 0
CHANGELOG.md

@@ -6,6 +6,7 @@
 	* Added CSP `Content-Security-Policy: default-src 'self'; child-src *; frame-src *; img-src * data:; media-src *` [#1075](https://github.com/FreshRSS/FreshRSS/issues/1075), [#1114](https://github.com/FreshRSS/FreshRSS/issues/1114)
 	* Added `X-Content-Type-Options: nosniff` [#1116](https://github.com/FreshRSS/FreshRSS/pull/1116)
 	* Cookie with `Secure` tag when used over HTTPS [#1117](https://github.com/FreshRSS/FreshRSS/pull/1117)
+	* Limit API post input to 1MB [#1118](https://github.com/FreshRSS/FreshRSS/pull/1118)
 * Features
 	* New list of domains for which to force HTTPS (for images, videos, iframes…) defined in `./data/force-https.default.txt` and `./data/force-https.txt` [#1083](https://github.com/FreshRSS/FreshRSS/issues/1083)
 		* In particular useful for privacy and to avoid mixed content errors, e.g. to see YouTube videos when FreshRSS is in HTTPS

+ 1 - 1
p/api/greader.php

@@ -23,7 +23,7 @@ Server-side API compatible with Google Reader API layer 2
 require('../../constants.php');
 require(LIB_PATH . '/lib_rss.php');	//Includes class autoloader
 
-$ORIGINAL_INPUT = file_get_contents('php://input');
+$ORIGINAL_INPUT = file_get_contents('php://input', false, null, -1, 1048576);
 
 if (PHP_INT_SIZE < 8) {	//32-bit
 	function dec2hex($dec) {