Index: tests/t3lib/cache/backend/t3lib_cache_backend_filebackendTest.php
===================================================================
--- tests/t3lib/cache/backend/t3lib_cache_backend_filebackendTest.php	(revision 9007)
+++ tests/t3lib/cache/backend/t3lib_cache_backend_filebackendTest.php	(working copy)
@@ -298,7 +298,103 @@
 	}
 
 	/**
+	 * @author Christian Kuhn <lolli@schwarzbu.ch>
+	 */
+	public function invalidEntryIdentifiers() {
+		return array(
+			'trailing slash' => array('/myIdentifer'),
+			'trailing dot and slash' => array('./myIdentifer'),
+			'trailing two dots and slash' => array('../myIdentifier'),
+			'trailing with multiple dots and slashes' => array('.././../myIdentifier'),
+			'slash in middle part' => array('my/Identifier'),
+			'dot and slash in middle part' => array('my./Identifier'),
+			'two dots and slash in middle part' => array('my../Identifier'),
+			'multiple dots and slashes in middle part' => array('my.././../Identifier'),
+			'pending slash' => array('myIdentifier/'),
+			'pending dot and slash' => array('myIdentifier./'),
+			'pending dots and slash' => array('myIdentifier../'),
+			'pending multiple dots and slashes' => array('myIdentifier.././../'),
+		);
+	}
+
+	/**
 	 * @test
+	 * @dataProvider invalidEntryIdentifiers
+	 * @expectedException InvalidArgumentException
+	 * @author Christian Kuhn <lolli@schwarzbu.ch>
+	 */
+	public function setThrowsExceptionForInvalidIdentifier($identifier) {
+		$mockCache = $this->getMock('t3lib_cache_frontend_AbstractFrontend', array(), array(), '', FALSE);
+		$mockCache->expects($this->atLeastOnce())->method('getIdentifier')->will($this->returnValue('UnitTestCache'));
+
+		$backend = $this->getMock('t3lib_cache_backend_FileBackend', array('dummy'), array(), '', TRUE);
+		$backend->setCache($mockCache);
+
+		$backend->set($identifier, 'cache data', array());
+	}
+
+	/**
+	 * @test
+	 * @dataProvider invalidEntryIdentifiers
+	 * @expectedException InvalidArgumentException
+	 * @author Christian Kuhn <lolli@schwarzbu.ch>
+	 */
+	public function getThrowsExceptionForInvalidIdentifier($identifier) {
+		$mockCache = $this->getMock('t3lib_cache_frontend_AbstractFrontend', array(), array(), '', FALSE);
+		$mockCache->expects($this->atLeastOnce())->method('getIdentifier')->will($this->returnValue('UnitTestCache'));
+
+		$backend = $this->getMock('t3lib_cache_backend_FileBackend', array('dummy'), array(), '', FALSE);
+		$backend->setCache($mockCache);
+
+		$backend->get($identifier);
+	}
+
+	/**
+	 * @test
+	 * @dataProvider invalidEntryIdentifiers
+	 * @expectedException InvalidArgumentException
+	 * @author Christian Kuhn <lolli@schwarzbu.ch>
+	 */
+	public function hasThrowsExceptionForInvalidIdentifier($identifier) {
+		$backend = $this->getMock('t3lib_cache_backend_FileBackend', array('dummy'), array(), '', FALSE);
+
+		$backend->has($identifier);
+	}
+
+	/**
+	 * @test
+	 * @dataProvider invalidEntryIdentifiers
+	 * @expectedException InvalidArgumentException
+	 * @author Christian Kuhn <lolli@schwarzbu.ch>
+	 */
+	public function removeThrowsExceptionForInvalidIdentifier($identifier) {
+		$mockCache = $this->getMock('t3lib_cache_frontend_AbstractFrontend', array(), array(), '', FALSE);
+		$mockCache->expects($this->atLeastOnce())->method('getIdentifier')->will($this->returnValue('UnitTestCache'));
+
+		$backend = $this->getMock('t3lib_cache_backend_FileBackend', array('dummy'), array(), '', FALSE);
+		$backend->setCache($mockCache);
+
+		$backend->remove($identifier);
+	}
+
+	/**
+	 * @test
+	 * @dataProvider invalidEntryIdentifiers
+	 * @expectedException InvalidArgumentException
+	 * @author Christian Kuhn <lolli@schwarzbu.ch>
+	 */
+	public function requireOnceThrowsExceptionForInvalidIdentifier($identifier) {
+		$mockCache = $this->getMock('t3lib_cache_frontend_AbstractFrontend', array(), array(), '', FALSE);
+		$mockCache->expects($this->atLeastOnce())->method('getIdentifier')->will($this->returnValue('UnitTestCache'));
+
+		$backend = $this->getMock('t3lib_cache_backend_FileBackend', array('dummy'), array(), '', FALSE);
+		$backend->setCache($mockCache);
+
+		$backend->requireOnce($identifier);
+	}
+
+	/**
+	 * @test
 	 * @author Robert Lemke <robert@typo3.org>
 	 * @author Karsten Dambekalns <karsten@typo3.org>
 	 * @author Ingo Renner <ingo@typo3.org>
Index: t3lib/cache/backend/class.t3lib_cache_backend_filebackend.php
===================================================================
--- t3lib/cache/backend/class.t3lib_cache_backend_filebackend.php	(revision 9007)
+++ t3lib/cache/backend/class.t3lib_cache_backend_filebackend.php	(working copy)
@@ -222,6 +222,13 @@
 			);
 		}
 
+		if ($entryIdentifier !== basename($entryIdentifier)) {
+			throw new InvalidArgumentException(
+				'The specified entry identifier must not contain a path segment.',
+				1282073032
+			);
+		}
+
 		$this->remove($entryIdentifier);
 
 		$temporaryCacheEntryPathAndFilename = $this->root . $this->cacheDirectory . uniqid() . '.temp';
@@ -271,6 +278,13 @@
 	 * @api
 	 */
 	public function get($entryIdentifier) {
+		if ($entryIdentifier !== basename($entryIdentifier)) {
+			throw new InvalidArgumentException(
+				'The specified entry identifier must not contain a path segment.',
+				1282073033
+			);
+		}
+
 		$pathAndFilename = $this->root . $this->cacheDirectory . $entryIdentifier;
 		if ($this->isCacheFileExpired($pathAndFilename)) {
 			return FALSE;
@@ -288,6 +302,13 @@
 	 * @api
 	 */
 	public function has($entryIdentifier) {
+		if ($entryIdentifier !== basename($entryIdentifier)) {
+			throw new InvalidArgumentException(
+				'The specified entry identifier must not contain a path segment.',
+				1282073034
+			);
+		}
+
 		return !$this->isCacheFileExpired($this->root . $this->cacheDirectory . $entryIdentifier);
 	}
 
@@ -301,6 +322,13 @@
 	 * @api
 	 */
 	public function remove($entryIdentifier) {
+		if ($entryIdentifier !== basename($entryIdentifier)) {
+			throw new InvalidArgumentException(
+				'The specified entry identifier must not contain a path segment.',
+				1282073035
+			);
+		}
+
 		$pathAndFilename = $this->root . $this->cacheDirectory . $entryIdentifier;
 		if (!file_exists($pathAndFilename)) {
 			return FALSE;
@@ -499,6 +527,13 @@
 	 * @api
 	 */
 	public function requireOnce($entryIdentifier) {
+		if ($entryIdentifier !== basename($entryIdentifier)) {
+			throw new InvalidArgumentException(
+				'The specified entry identifier must not contain a path segment.',
+				1282073036
+			);
+		}
+
 		$pathAndFilename = $this->root . $this->cacheDirectory . $entryIdentifier;
 		return ($this->isCacheFileExpired($pathAndFilename)) ? FALSE : require_once($pathAndFilename);
 	}
