question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Limit `include` access

See original GitHub issue

Hi,

Recently we run into security issue with EJS include being able to access any file on the system. Which means, that any application running on common server could include files from home, root and and other personal data directories.

It’s possible to do something like this <%- include('/path/to/home/.ssh/id_rsa' %>, stealing private content from the server. This is quite a big breach, potentially leading to many problems.

I was investigating the possibilities of limiting EJS include for some specific fs scope, and seems like there’s no workaround for this, except special node environment set-up in isolated sandbox or forking EJS. I also tried to override include helper function, which is possible, but I couldn’t managed to implement scoping for nested includes. Also, legacy support for older include syntax is not possible to override from outside.

Potential solution for the problem is based on providing an additional option with defined sandbox directory path. This option could be then used to limit fs lookups, limiting access outside defined space.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
therobhrtcommented, Mar 31, 2016

@RyanZim I have my fork done (https://github.com/operatino/ejs/commit/3bb676f3e8b77eaa7f4ea774185c2ff2ed17b950), will do a PR as soon as I’ll have time.

0reactions
RyanZimcommented, Mar 31, 2016

@operatino, are you working on this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Access specifications - Microsoft Support
Find limits and specifications for Access 2016 database files and objects, such as the maximum file size or the maximum number of fields...
Read more >
Microsoft Access 2016 Maximum Limits and Specifications
Microsoft Access database: Maximum size of 2 gigabytes (includes all objects minus the space needed for system objects all database objects and data)....
Read more >
how to use LIMIT in query of MS ACCESS - sql - Stack Overflow
I want to do a paging system using php i'am using access for my data base and it doesn't allow me to do...
Read more >
Pro tip: Limit the number of records in an Access group
You don't need an expertise in SQL to limit the number of records in a group. With your user knowledge of queries and...
Read more >
What is the limit to using Microsoft Access? - Quora
Why does Microsoft Access have a 2GB limit on the size of a database? Because it ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found