From 9e5899cac1a6367e3769af52a724821880e538f6 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 29 Jan 2018 16:15:41 +0100 Subject: Check that Date of Release file is not in the future By restricting the Date field to be in the past, an attacker cannot just create a repository from the future that would be accepted as a valid update for a repository. This check can be disabled by Acquire::Check-Date set to false. This will also disable Check-Valid-Until and any future date related checking, if any - the option means: "my computers date cannot be trusted." Modify the tests to allow repositories to be up to 10 hours in the future, so we can keep using hours there to simulate time changes. --- doc/apt.conf.5.xml | 21 +++++++++++++++++++++ doc/examples/configure-index | 3 +++ doc/sources.list.5.xml | 17 +++++++++++++++++ 3 files changed, 41 insertions(+) (limited to 'doc') diff --git a/doc/apt.conf.5.xml b/doc/apt.conf.5.xml index fdcd99425..e285b3130 100644 --- a/doc/apt.conf.5.xml +++ b/doc/apt.conf.5.xml @@ -315,6 +315,27 @@ APT::Compressor::rev { for the download itself (see also &sources-list;). + + + Security related option defaulting to true, enabling time-related + checks. Disabling it means that the machine's time cannot be + trusted, and APT will hence disable all time-related checks, + such as and verifying that + the Date field of a release file is not in the future. + + + + + Maximum time (in seconds) before its creation (as indicated + by the Date header) that the Release + file should be considered valid. + + The default value is 10. + Archive specific settings can be made by appending the label of the archive + to the option name. Preferably, the same can be achieved for specific + &sources-list; entries by using the option there. + + Security related option defaulting to true, as giving a Release file's diff --git a/doc/examples/configure-index b/doc/examples/configure-index index 9088bd844..8a74fde2d 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -234,6 +234,9 @@ Acquire Max-ValidTime::* ""; // repository label specific configuration Min-ValidTime ""; // time in seconds Min-ValidTime::* ""; // repository label specific configuration + Check-Date ""; // whether to check the "Date" field + Max-FutureTime ""; // seconds to allow release file's Date field to be in the future (default 10) + Max-FutureTime::* ""; // repository label specific configuration SameMirrorForAllIndexes ""; // use the mirror serving the Release file for Packages & co diff --git a/doc/sources.list.5.xml b/doc/sources.list.5.xml index 2a047c83b..592227dd8 100644 --- a/doc/sources.list.5.xml +++ b/doc/sources.list.5.xml @@ -343,6 +343,23 @@ deb-src [ option1=value1 option2=value2 ] uri suite [component1] [component2] [. default. + () + is a yes/no value which controls if APT should consider + the machine's time correct and hence perform time related + checks, such as verifying that a Release file is not + from the future. Disabling it also disables the + option + mentioned above. + + + + () controls how far + from the future a repository may be. + Default to the value of the configuration option + which is + 10 seconds by default. + + () determines the path to the InRelease file, relative to the normal position of an InRelease file. -- cgit v1.2.3