Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A Google-style captcha for enterprise Rails apps
Tested with Ruby 1.8.6, 1.8.7, and 1.9.1.
script/plugin install git://github.com/winton/captcha.git
Captcha::Config.new( # Used for filename cipher :password => 'something-unique', # Captcha colors :colors => { :background => '#FFFFFF', :font => '#080288' }, # Number of captcha images to generate :count => RAILS_ENV == 'production' ? 500 : 10, # Where to write captchas :destination => "#{RAILS_ROOT}/public/images/captchas", # Generate new batch every day :generate_every => 24 * 60 * 60 )
See lib/captcha/config.rb
for more options.
class ApplicationController < ActionController::Base acts_as_captcha end
You may now use the reset_captcha
method in any controller.
class User < ActiveRecord::Base acts_as_captcha :base => "base error when captcha fails", :field => "field error when captcha fails" end
With no parameters, a default error is added to the "captcha" field (:field => true
).
Specify :base => true
to use a default error for base.
<img src="/images/captchas/<%= session[:captcha] %>.jpg" /> <%= text_field_tag(:captcha) %>
user = User.new user.known_captcha = session[:captcha] user.captcha = params[:captcha] user.save reset_captcha
0 0 * * * cd /path/to/rails/app && /usr/bin/rake RAILS_ENV=production captcha:generate
Your config file sets the captcha refresh period. The rake task just checks if its time to repopulate, and does so if necessary.
FAQs
Unknown package
We found that captcha 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
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.