
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
tinymce-rails-fileupload
Advanced tools
Simple plugin for TinyMCE4 that allows for uploading files from your computer and inserting a link to the uploaded document.
It makes no assumption on how you store the files, it simply POSTs data to a URL and expects a JSON response (see the Setup).
This plugin started as a copy of tinymce-rails-imageupload.
A small app demonstrating a working setup with Rails 4 is available here.
Add this line to your application's Gemfile:
gem 'tinymce-rails-fileupload'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install tinymce-rails-fileupload
.tinymce()
, addplugins: "uploadfile"
# toolbar option must include "uploadfile" somewhere to have the button appear
and the rest should happen automatically.
The plugin defaults to POSTing to /tinymce_assets
.
You may modify it by supplying the option uploadfile_form_url
in the call to .tinymce()
Routing to your controller must be done manually.
Set it up using something similar in routes.rb
:
post '/tinymce_assets' => 'tinymce_assets#create'
This action gets called with a file parameter creatively called document[file]
,
and must respond with JSON, containing the URL and title of the document.
The JSON has to be returned with a content type of "text/html" to work.
Example:
class TinymceAssetsController < ApplicationController
def create
document = Document.create(document_params)
render json: {
document: {
url: document.file.url,
title: document.title
}
}, layout: false, content_type: "text/html"
end
private
def document_params
params.require(:document).permit(:file, :title)
end
end
Inserted HTML is just <a href="..." title="...">Link text</a>
.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that tinymce-rails-fileupload demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.