Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zmap
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
zmap
Commits
2471d5a2
Commit
2471d5a2
authored
15 years ago
by
mh17
Browse files
Options
Downloads
Patches
Plain Diff
fixed RT122984 and further securitised URLs by patching out shell chars that run extra programs
parent
e60e1ccf
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/zmapUtils/zmapWebBrowser.c
+18
-2
18 additions, 2 deletions
src/zmapUtils/zmapWebBrowser.c
with
18 additions
and
2 deletions
src/zmapUtils/zmapWebBrowser.c
+
18
−
2
View file @
2471d5a2
...
...
@@ -28,7 +28,7 @@
* HISTORY:
* Last edited: Jun 9 16:20 2009 (edgrif)
* Created: Thu Mar 23 13:35:10 2006 (edgrif)
* CVS info: $Id: zmapWebBrowser.c,v 1.
6
20
09-06-10 10:05:44 edgrif
Exp $
* CVS info: $Id: zmapWebBrowser.c,v 1.
7
20
10-01-21 14:42:29 mh17
Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -284,7 +284,11 @@ static void makeBrowserCmd(GString *cmd, BrowserConfig best_browser, char *url)
* to the shell these get wrongly interpreted by the shell in its normal
* string fashion so we translate them all to "%27".
*
*
* mh17: for security we need to patch out other shell special characters such as '|', ';', '`'. >,< should be harmless
* Anything that allows a user to run another command is a no-no
* This gets inefficient (perl and php might do this better)
* we can quote the url, but that opens the door to interpretation, better to code metachars as hex.
* The returned string should be g_free'd when no longer needed.
*/
static
char
*
translateURLChars
(
char
*
orig_link
)
...
...
@@ -303,6 +307,18 @@ static char *translateURLChars(char *orig_link)
source
=
"%27"
;
zMap_g_string_replace
(
link
,
target
,
source
)
;
target
=
"&"
;
source
=
"%26"
;
zMap_g_string_replace
(
link
,
target
,
source
)
;
target
=
"|"
;
source
=
"%7C"
;
zMap_g_string_replace
(
link
,
target
,
source
)
;
target
=
"`"
;
source
=
"%60"
;
zMap_g_string_replace
(
link
,
target
,
source
)
;
url
=
g_string_free
(
link
,
FALSE
)
;
return
url
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment