Skip to content
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

Frontend Upload Sicherheitslücke? #33

Closed
rkemmere opened this issue Jul 31, 2020 · 5 comments
Closed

Frontend Upload Sicherheitslücke? #33

rkemmere opened this issue Jul 31, 2020 · 5 comments

Comments

@rkemmere
Copy link
Member

Leider bekomme ich es nicht hin, das für jeden Besucher beim hochladen ein eigener Ordner genommen wird .
Wenn ich es mit zwei Nutzern teste, sieht jeder der Nutzer was der andere hochgeladen hat.

Die uniqueId wird irgendwie gar nicht durchgeschleift.

@alxndr-w
Copy link
Member

und #22

@alxndr-w
Copy link
Member

Konntest du das Problem noch lösen?

@rkemmere
Copy link
Member Author

rkemmere commented Feb 17, 2021

Ich habe es so gelöst, dass ich die unique ID mit Abfrage.

`
// Ausgabe bisher hochgeladener Dateien
$result = array();
$uniqueKey = rex_request("uniqueKey", 'string', 'public');

		if(file_exists(self::getPath()) && $uniqueKey != "") {
			$files = scandir(self::getPath());
			if ( false !== $files ) {
				foreach ( $files as $file ) {
					if ( '.' != $file && '..' != $file) {
						$obj['name'] = $file;
						$obj['uniqueKey'] = $uniqueKey;
						$obj['size'] = filesize(self::getPath().$file);
						$result[] = $obj;
					}
				}
			}
		 }
		header('Content-type: text/json');
		header('Content-type: application/json');
		exit( json_encode( $result ) );

	}`

@alxndr-w
Copy link
Member

PR welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants