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.
The LineCache module allows one to get any line from any file, caching the lines and file information on first access to the file. Although the file may be any file, the common use is when the file is a Ruby script since parsing of the file is done to figure out where the statement boundaries are, and we also cache syntax formatting.
The routines here may be is useful when a small random sets of lines are read from a single file, in particular in a debugger to show source lines.
Example:
require 'linecache'
lines = LineCache::getlines('/tmp/myruby.rb')
# The following lines have same effect as the above.
$: << '/tmp'
Dir.chdir('/tmp') {lines = LineCache::getlines('myruby.rb')
line = LineCache::getline('/tmp/myruby.rb', 6)
# Note lines[6] == line (if /tmp/myruby.rb has 6 lines)
LineCache::clear_file_cache
LineCache::clear_file_cache('/tmp/myruby.rb')
LineCache::update_cache # Check for modifications of all cached files.
This code is for Ruby version 2 and greater.
FAQs
Unknown package
We found that linecache2 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.