Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix : Prevent potential LFI by ensuring filename uses basename #163

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/ontologies_linked_data/models/ontology_submission.rb
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def self.submission_id_generator(ss)
# Copy file from /tmp/uncompressed-ont-rest-file to /srv/ncbo/repository/MY_ONT/1/
def self.copy_file_repository(acronym, submissionId, src, filename = nil)
path_to_repo = File.join([LinkedData.settings.repository_folder, acronym.to_s, submissionId.to_s])
name = filename || File.basename(File.new(src).path)
name = filename.nil? ? File.basename(File.new(src).path) : File.basename(filename)
# THIS LOGGER IS JUST FOR DEBUG - remove after NCBO-795 is closed
logger = Logger.new(Dir.pwd + "/create_permissions.log")
if not Dir.exist? path_to_repo
Expand Down
Loading