Giter VIP home page Giter VIP logo

michaelschwarz / ajax.net-professional Goto Github PK

View Code? Open in Web Editor NEW
38.0 38.0 27.0 438 KB

Ajax.NET Professional (AjaxPro) is one of the first AJAX frameworks available for Microsoft ASP.NET and is working with many .NET frameworks starting with v1.1.

Home Page: https://www.ajaxpro.info

License: MIT License

C# 95.79% JavaScript 4.21%
ajax ajax-framework ajax-json ajax-net ajaxnet ajaxpro asp-net csharp javascript json

ajax.net-professional's People

Contributors

h0ng10 avatar laureysruben avatar maraymer avatar michaelschwarz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ajax.net-professional's Issues

Compiled regex making GetIJavaScriptObjectFromXmlNode slower

We've recently updated the library from 6.7.20.1 to 21.12.22.1 due to the security vulnerabilities and have found the library to run considerably slower after the upgrade. We've narrowed down the change to this commit: cded013#diff-11180be976ef7ec%5B%E2%80%A6%5Ddf0a3ac2ffef214b9R344
and this line specifically:

System.Text.RegularExpressions.Regex r = new System.Text.RegularExpressions.Regex(@"\w+|\W+", System.Text.RegularExpressions.RegexOptions.Compiled);

It looks like adding the option System.Text.RegularExpressions.RegexOptions.Compiled has made it slower as the regex needs to be initialized everytime the function is called. As the function is recursive for each xml node, manual testing has shown our ajax calls go considerably slower, with the size of the data increasing the time for the ajax requests to load

Loading a dataset of ~100 goes from from <100ms to ~500ms
Loading a dataset of ~1000 goes from <200ms to ~7seconds

As a fix, making the regex a private static variable with the compiled option seems to reduce the time back to normal or it could be reverted back to what it was before without the compiled option.

Had a quick look elsewhere in the library where regexes are referenced too and it looks like its generally declared as a private variable in the class instead of within a function (https://github.com/michaelschwarz/Ajax.NET-Professional/blob/f845e338904de7db69086[โ€ฆ]7a2d33840b1dd8b62b/AjaxPro/JSON/Converters/DateTimeConverter.cs) so creating a private static variable for it would be consistent with other places where regexes are used

some problems about Content Security Policy Header

Ajaxpro is used in my project, which will eventually generate some JavaScript code on the web page. Now I need to handle the inline JavaScript code with "content security policy header"

My purpose is as follows:

Before:

<script> function fun(){ // some code generated by ajaxPro } </script>

After:

<script nonce='abcdefghijklmnopqrstuvwxyz'> function fun(){ // some code generated by ajaxPro } </script>

I added the following configuration in the web.config file

<httpProtocol>

<customHeaders>

<add name ="Content-Security-Policy" value ="frame-ancestors myhost.com; script-src 'self' https://myhost.com 'unsafe-eval' 'unsafe-hashes' 'nonce-abcdefghijklmnopqrstuvwxyz';" />

</customHeaders>

</httpProtocol>


My question is: how can I add 'nonce' to the < script > tag generated by ajaxpro?

If you need more information, you can email me: [email protected]

Async call issue

I am trying async call [AjaxMethod(HttpSessionStateRequirement.ReadWrite, true)]

But Javascript still call this: return r.invoke(method, args);
Instead of declared with callback: invoke: function(method, args, callback, context) {

Uncaught TypeError: this.onTimeout is not a function

core.ashx:395 Uncaught TypeError: this.onTimeout is not a function
at AjaxPro.Request.timeout (core.ashx:395)

var r = this.onTimeout(this.duration, this);

this line code return error in core.js in chrom browser.

Potential security issue

Hello

We discovered a potential security issue within this framework. Can you please provide me a contact that I can use to send details to?

Kind regards

MD5 is reported unsafed

As title said, I think md5 is not a safe way to encrypt.
Then we use sha256 instead.

return BitConverter.ToString(new SHA256Managed().ComputeHash(data)).Replace("-", String.Empty);

Security vulnerability in Ajax Pro 2

Hi, we believe we've discovered a vulnerability within the ajax.net professional code that is exploitable.
As per the security.md, we would like to work together with the maintainers of this repository to draft a security advisory and to request a CVE for this vulnerability.

Let me know how you would like to proceed, thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.