Project

General

Profile

« Previous | Next » 

Revision 639

Added by thorn almost 17 years ago

Security bugfix: Text file for text-captcha was readable from everywhere. Text-captcha: empty line in test file, following a question, was accepted as answer. Fixed.

View differences:

tool.php
56 56
		$text_qa=$_POST['text_qa'];
57 57
		if(strpos($text_qa, '### example ###') === FALSE) {
58 58
			$text_qa=$admin->add_slashes($text_qa);
59
			if($fh = fopen(WB_PATH.'/temp/.captcha_text.txt', 'wb')) {
59
			$text_qa="<?php die(header('Location: ../index.php')); ?>\n".$text_qa;
60
			if($fh = fopen(WB_PATH.'/temp/.captcha_text.php', 'wb')) {
60 61
				fwrite($fh, $text_qa);
61 62
				fclose($fh);
62 63
			}
......
78 79
	// load text-captchas
79 80
	$text_qa='';
80 81
	if(file_exists(WB_PATH.'/include/captcha/captchas/text.php')) {
81
		if(file_exists(WB_PATH.'/temp/.captcha_text.txt')) {
82
			@$content = file(WB_PATH.'/temp/.captcha_text.txt');
82
		if(file_exists(WB_PATH.'/temp/.captcha_text.php')) {
83
			@$content = file(WB_PATH.'/temp/.captcha_text.php');
83 84
			if($content!==FALSE) {
85
				$content[0]='';
84 86
				$text_qa = $admin->strip_slashes(implode('', $content));
85 87
			}
86 88
		}

Also available in: Unified diff