85fd1a
From c60c227ab9a36246730d7454e33d40d2c66c88b3 Mon Sep 17 00:00:00 2001
85fd1a
From: Kamil Dudka <kdudka@redhat.com>
85fd1a
Date: Wed, 13 Feb 2013 15:26:22 +0100
85fd1a
Subject: [PATCH] fix CVE-2008-4690
85fd1a
85fd1a
prompt user before executing command via a lynxcgi link even in advanced mode,
85fd1a
as the actual URL may not be shown but hidden behind an HTTP redirect and set
85fd1a
TRUSTED_LYNXCGI:none in lynx.cfg to disable all lynxcgi URLs by default
85fd1a
---
85fd1a
 CHANGES     |    7 +++++++
85fd1a
 lynx.cfg    |    2 +-
85fd1a
 src/LYCgi.c |    2 +-
85fd1a
 3 files changed, 9 insertions(+), 2 deletions(-)
85fd1a
85fd1a
diff --git a/CHANGES b/CHANGES
85fd1a
index 360be68..8eca013 100644
85fd1a
--- a/CHANGES
85fd1a
+++ b/CHANGES
85fd1a
@@ -721,6 +721,13 @@ Changes since Lynx 2.8 release
85fd1a
 * update win32 makefiles/build scripts to add LYmktime, parsdate modules -TD
85fd1a
 * update config.guess (2008-04-14), config.sub (2008-06-16)
85fd1a
 
85fd1a
+2008-10-26
85fd1a
+* modify patch for CVE-2005-2929 to prompt user before executing command via
85fd1a
+  a lynxcgi link even in advanced mode, as the actual URL may not be shown but
85fd1a
+  hidden behind an HTTP redirect
85fd1a
+* set TRUSTED_LYNXCGI:none in lynx.cfg to disable all lynxcgi URLs by default
85fd1a
+  [CVE-2008-4690]
85fd1a
+
85fd1a
 2008-09-21 (2.8.7dev.10)
85fd1a
 * remove rw.po, since the translation project no longer supplies it -TD
85fd1a
 * implement "readonly" attribute for TEXTAREA and TEXT fields -TD
85fd1a
diff --git a/lynx.cfg b/lynx.cfg
85fd1a
index ee2aad3..144050d 100644
85fd1a
--- a/lynx.cfg
85fd1a
+++ b/lynx.cfg
85fd1a
@@ -1061,7 +1061,7 @@ DEFAULT_INDEX_FILE:http://scout.wisc.edu/
85fd1a
 #
85fd1a
 # The default TRUSTED_LYNXCGI rule is "none".
85fd1a
 #
85fd1a
-#TRUSTED_LYNXCGI:none
85fd1a
+TRUSTED_LYNXCGI:none
85fd1a
 
85fd1a
 .h2 LYNXCGI_ENVIRONMENT
85fd1a
 # Unix:
85fd1a
diff --git a/src/LYCgi.c b/src/LYCgi.c
85fd1a
index 832bb89..0ae8a7e 100644
85fd1a
--- a/src/LYCgi.c
85fd1a
+++ b/src/LYCgi.c
85fd1a
@@ -164,7 +164,7 @@ static BOOL can_exec_cgi(const char *linktext, const char *linkargs)
85fd1a
     if (!exec_ok(HTLoadedDocumentURL(), linktext, CGI_PATH)) {
85fd1a
 	/* exec_ok gives out msg. */
85fd1a
 	result = FALSE;
85fd1a
-    } else {
85fd1a
+    } else if (user_mode < ADVANCED_MODE) {
85fd1a
 	StrAllocCopy(command, linktext);
85fd1a
 	if (non_empty(linkargs)) {
85fd1a
 	    HTSprintf(&command, " %s", linkargs);
85fd1a
-- 
85fd1a
1.7.1
85fd1a