Computer
Linus Torvalds Would Reportedly Merge Rust Kernel Code Over Maintainer Objections
Read more of this story at Slashdot.
'Uber For Armed Guards' Rushes To Market
Read more of this story at Slashdot.
AI 'Hallucinations' in Court Papers Spell Trouble For Lawyers
Read more of this story at Slashdot.
Groups Ask US Court To Reconsider Ruling Blocking Net Neutrality Rules
Read more of this story at Slashdot.
Lloyds Is Auditing Thousands of IT Staffers' Technical Skills
Read more of this story at Slashdot.
27% of Job Listings For CFOs Now Mention AI
Read more of this story at Slashdot.
DeepSeek Expands Business Scope in Potential Shift Towards Monetization
Read more of this story at Slashdot.
Nokia is Putting the First Cellular Network On the Moon
Read more of this story at Slashdot.
Scientists Develop 'Injection' To Make Smartphone and EV Batteries Last Longer
Read more of this story at Slashdot.
'Unconventional' Nickel Superconductor Excites Physicists
Read more of this story at Slashdot.
Acer To Raise US Laptop Prices 10% After Tariffs
Read more of this story at Slashdot.
Former Staffers Say India's Biggest IT Firm Was Gaming the US Visa System
Read more of this story at Slashdot.
Free Software Foundation Speaks Up Against Red Hat Source Code Announcement
Read more of this story at Slashdot.
PlayStation Veteran Blames Gaming Industry Slump on Pandemic Overexpansion
Read more of this story at Slashdot.
xAI Releases Its Latest Flagship Model, Grok 3
Read more of this story at Slashdot.
CodeSOD: The Mask Service
Gretchen saw this line in the front-end code for their website and freaked out:
let bucket = new AWS.S3({ params: { Bucket: 'initech-logos' } });This appeared to be creating an object to interact with an Amazon S3 bucket on the client side. Which implied that tokens for interacting with S3 were available to anyone with a web browser.
Fortunately, Gretchen quickly realized that this line was commented out. They were not hosting publicly available admin credentials on their website anymore.
.comment { border: none; }They used to, however, and the comments in the code made this a bit more clear:
// inside an angular component: uploadImage(): void { const uniqueName = `${this.utils.generateUUID()}_${this.encrDecSrvc.getObject(AppConstants.companyID)}_${this.file.name}` /*; @note: Disable usage of aws credential, transfer flow to the backend. @note; @disable-aws-credential */ /*; AWS.config.region = 'us-east-1' let bucket = new AWS.S3({ params: { Bucket: 'initech-billinglogos' } }); */ const bucket = ( AWSBucketMask ); const params = { Bucket: 'initech-logos', Key: 'userprofilepic/' + uniqueName, ACL: "public-read", Body: this.file }; const self = this; bucket.upload( params, function (err, data) { if (err) { console.log("error while saving file on s3 server", err); return; } self.isImageUrl = true; self.imageUrl = data.Location; self.myProfileForm.controls['ProfilePic'].setValue(self.imageUrl); self.encrDecSrvc.addObject(AppConstants.imageUrl, self.imageUrl); self.initechAPISrvc.fireImageView(true); self.saveProfileData(); self.fileUpload.clear() }, self.APISrvc ); }Boy, this makes me wonder what that AWSBucketMask object is, and what its upload function does.
export class AWSBucketMask { public static async upload( option, callback, service ){ const fileReader = new FileReader( ); fileReader.onloadend = ( ( ) => { const dataURI = ( `${ fileReader.result }` ); const [ entityType, mimeType, baseType, data ] = ( dataURI.split( /[\:\;\,]/ ) ); option.ContentEncoding = baseType; option.ContentType = mimeType; option.Body = data; service.awsBucketMaskUpload( option ) .subscribe( function( responseData ){ callback( null, responseData.data ); }, function( error ){ callback( error ); } ); } ); fileReader.readAsDataURL( option.Body ); } public static async deleteObject( option, callback, service ){ service.awsBucketMaskDeleteObject( option ) .subscribe( function( responseData ){ callback( null, responseData ); }, function( error ){ callback( error ); } ); } public static async deleteObjects( option, callback, service ){ service.awsBucketMaskDeleteObjects( option ) .subscribe( function( responseData ){ callback( null, responseData ); }, function( error ){ callback( error ); } ); } public static async getSignedUrl( namespace, option, callback, service ){ service.awsBucketMaskGetSignedUrl( namespace, option ) .subscribe( function( responseData ){ callback(null, responseData.data); }, function( error ){ callback( error ); } ); } }The important thing to notice here is that each of the methods here invokes a web service service.awsBucketMaskUpload, for example. Given that nothing actually checks their return values and it's all handled through callback hell, this is a clear example of async pollution- methods being marked async without understanding what async is supposed to do.
But that's not the real WTF. You may notice that these calls back to the webservice are pretty thin. You see, here's the problem: originally, they just bundled the S3 into the client-side, so the client-side code could do basically anything it wanted to in S3. Adding a service to "mask" that behavior would have potentially meant doing a lot of refactoring, so instead they made the service just a dumb proxy. Anything you want to do on S3, the service does for you. It does no authentication. It does no authorization. It runs with the admin keys, so if you can imagine a request you want to send it, you can send it that request. But at least the client doesn't have access to the admin keys any more.
This is an accounting application, so some of the things stored in S3 are confidential financial information.
Gretchen writes:
We have to take cybersecurity courses every 3 months, but it seems like this has no effect on the capabilities of my fellow coworkers.
You can lead a programmer to education, but you can't make them think.
[Advertisement] Plan Your .NET 9 Migration with ConfidenceYour journey to .NET 9 is more than just one decision.Avoid migration migraines with the advice in this free guide. Download Free Guide Now!
Sandisk Puts Petabyte SSDs On the Roadmap
Read more of this story at Slashdot.
NAND Flash Prices Plunge Amid Supply Glut, Factory Output Cut
Read more of this story at Slashdot.
Mexico Threatens To Sue Google Over Gulf Renaming
Read more of this story at Slashdot.
When a Lifetime Subscription Can Save You Money - and When It's Risky
Read more of this story at Slashdot.