ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:92580] [Ruby trunk Bug#15835] Path traversal symlink - WEBrick
       [not found] <redmine.issue-15835.20190507093317@ruby-lang.org>
@ 2019-05-07  9:33 ` mishra.dhiraj95
  2019-05-07 12:30 ` [ruby-core:92583] " naruse
  2019-05-08 15:04 ` [ruby-core:92599] " shevegen
  2 siblings, 0 replies; 3+ messages in thread
From: mishra.dhiraj95 @ 2019-05-07  9:33 UTC (permalink / raw)
  To: ruby-core

Issue #15835 has been reported by Dhiraj (Dhiraj Mishra).

----------------------------------------
Bug #15835: Path traversal symlink - WEBrick
https://bugs.ruby-lang.org/issues/15835

* Author: Dhiraj (Dhiraj Mishra)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.6.3
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
**Summary:**
A path traversal issue was observed in WEBrick ( WEBrick/1.4.2 (Ruby/2.6.3/2019-04-16)) via symlink. WEBrick serves static page for the current directory once enabled, however using symlink attacker could view data outside the hosted/running directory.

**Steps to reproduce:**
> mkdir nothing
> cd nothing
> ln -s ../../ symlnk
> ruby -run -ehttpd . -p8080

**Impact:**
This would allow the attacker to view sensitive data outside the root/running directory. 

**Recommendation:**
We can probably educate users about this behavior in the WebBrick documentation and providing a flag/parameter to disable/enable following symlinks.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:92583] [Ruby trunk Bug#15835] Path traversal symlink - WEBrick
       [not found] <redmine.issue-15835.20190507093317@ruby-lang.org>
  2019-05-07  9:33 ` [ruby-core:92580] [Ruby trunk Bug#15835] Path traversal symlink - WEBrick mishra.dhiraj95
@ 2019-05-07 12:30 ` naruse
  2019-05-08 15:04 ` [ruby-core:92599] " shevegen
  2 siblings, 0 replies; 3+ messages in thread
From: naruse @ 2019-05-07 12:30 UTC (permalink / raw)
  To: ruby-core

Issue #15835 has been updated by naruse (Yui NARUSE).

Status changed from Open to Feedback

On Apache with `FollowSymLinks` enabled, it can traverse out of DocumentRoot.
hxxps://httpd.apache.org/docs/2.4/en/urlmapping.html
Therefore it's not a problem.

----------------------------------------
Bug #15835: Path traversal symlink - WEBrick
https://bugs.ruby-lang.org/issues/15835#change-77945

* Author: Dhiraj (Dhiraj Mishra)
* Status: Feedback
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.6.3
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
**Summary:**
A path traversal issue was observed in WEBrick ( WEBrick/1.4.2 (Ruby/2.6.3/2019-04-16)) via symlink. WEBrick serves static page for the current directory once enabled, however using symlink attacker could view data outside the hosted/running directory.

**Steps to reproduce:**
> mkdir nothing
> cd nothing
> ln -s ../../ symlnk
> ruby -run -ehttpd . -p8080

**Impact:**
This would allow the attacker to view sensitive data outside the root/running directory. 

**Recommendation:**
We can probably educate users about this behavior in the WebBrick documentation and providing a flag/parameter to disable/enable following symlinks.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:92599] [Ruby trunk Bug#15835] Path traversal symlink - WEBrick
       [not found] <redmine.issue-15835.20190507093317@ruby-lang.org>
  2019-05-07  9:33 ` [ruby-core:92580] [Ruby trunk Bug#15835] Path traversal symlink - WEBrick mishra.dhiraj95
  2019-05-07 12:30 ` [ruby-core:92583] " naruse
@ 2019-05-08 15:04 ` shevegen
  2 siblings, 0 replies; 3+ messages in thread
From: shevegen @ 2019-05-08 15:04 UTC (permalink / raw)
  To: ruby-core

Issue #15835 has been updated by shevegen (Robert A. Heiler).


While I agree with naruse, it may be worthwhile to mention this briefly at e. g. 
https://ruby-doc.org/stdlib/libdoc/webrick/rdoc/WEBrick.html - it could still surprise
users so it could be useful to mention it; perhaps at the section "WEBrick can be run
as a production server for small loads.".

As writing documentation is always a bit tedious, I will try my luck with a slight
modification to it here, from:

"WEBrick can be run as a production server for small loads. Be aware that symlinks 
might allow users to view data outside of the designated root directory, such as
for the Apache webserver with the FollowSymlinks option enabled".

Not sure if this is great but I just wanted to provide a bit of text - perhaps it
can help others adapt it and write an improved documentation; it's just a suggestion.

----------------------------------------
Bug #15835: Path traversal symlink - WEBrick
https://bugs.ruby-lang.org/issues/15835#change-77959

* Author: Dhiraj (Dhiraj Mishra)
* Status: Feedback
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.6.3
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
**Summary:**
A path traversal issue was observed in WEBrick ( WEBrick/1.4.2 (Ruby/2.6.3/2019-04-16)) via symlink. WEBrick serves static page for the current directory once enabled, however using symlink attacker could view data outside the hosted/running directory.

**Steps to reproduce:**
> mkdir nothing
> cd nothing
> ln -s ../../ symlnk
> ruby -run -ehttpd . -p8080

**Impact:**
This would allow the attacker to view sensitive data outside the root/running directory. 

**Recommendation:**
We can probably educate users about this behavior in the WebBrick documentation and providing a flag/parameter to disable/enable following symlinks.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-08 15:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-15835.20190507093317@ruby-lang.org>
2019-05-07  9:33 ` [ruby-core:92580] [Ruby trunk Bug#15835] Path traversal symlink - WEBrick mishra.dhiraj95
2019-05-07 12:30 ` [ruby-core:92583] " naruse
2019-05-08 15:04 ` [ruby-core:92599] " shevegen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).