Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mechko/JSON-java
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: stleary/JSON-java
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 20 commits
  • 11 files changed
  • 5 contributors

Commits on Jul 13, 2026

  1. 1063-option-3 parserConfig set max len

    Sean Leary Sean Leary
    Sean Leary authored and Sean Leary committed Jul 13, 2026
    Configuration menu
    Copy the full SHA
    90563eb View commit details
    Browse the repository at this point in the history

Commits on Jul 14, 2026

  1. stleary#1063: bound BigDecimal->BigInteger expansion in objectToBigIn…

    …teger
    
    Completes the CVE-2026-59171 fix started in ab92bb9 / stleary#1065. The
    1000-char length guard in stringToValue admits short exponent-notation
    literals (e.g. 1e100000000, 11 chars) which are stored compactly as
    BigDecimal and only expand when getBigInteger/optBigInteger calls
    BigDecimal.toBigInteger(), materialising ~10^8 digits and stalling the
    thread or throwing OOM.
    
    Guard both toBigInteger() sites in objectToBigInteger by rejecting any
    BigDecimal whose integer part would exceed
    ParserConfiguration.DEFAULT_MAX_NUMBER_LENGTH decimal digits
    (precision() - scale(), both O(1) reads). Returns defaultValue on
    overflow, matching the method's existing behaviour for non-finite and
    unparseable values.
    
    Covers JSONObject.getBigInteger/optBigInteger and
    JSONArray.getBigInteger/optBigInteger (all delegate to this helper).
    
    Adds JSONObjectTest.getBigIntegerHugeExponentReturnsDefault with a 5s
    timeout so a regression fails fast rather than hanging CI.
    
    Co-Authored-By: Claude <noreply@anthropic.com>
    mechko and claude committed Jul 14, 2026
    Configuration menu
    Copy the full SHA
    fce83c9 View commit details
    Browse the repository at this point in the history
  2. stleary#1063: add comment to expected-exception catch block (SonarClo…

    …ud java:S108)
    
    Co-Authored-By: Claude <noreply@anthropic.com>
    mechko and claude committed Jul 14, 2026
    Configuration menu
    Copy the full SHA
    e40d933 View commit details
    Browse the repository at this point in the history

Commits on Jul 16, 2026

  1. stleary#1063: add JSONParserConfiguration overloads for getBigInteger…

    …/optBigInteger
    
    Per review on stleary#1067:
    - objectToBigInteger(val, dflt, JSONParserConfiguration) uses
      cfg.getMaxNumberLength() for the digit-count guard; -1 disables it.
      Existing 2-arg form delegates with a default config.
    - New public overloads on JSONObject and JSONArray:
      getBigInteger(key, cfg) / optBigInteger(key, dflt, cfg).
      Existing methods delegate with a default config.
    - objectToBigDecimal left unchanged (no expansion path; agreed on PR).
    - Tests cover default (1000), raised (2000), lowered (5), disabled (-1),
      null config, and JSONArray overloads.
    
    Co-Authored-By: Claude <noreply@anthropic.com>
    mechko and claude committed Jul 16, 2026
    Configuration menu
    Copy the full SHA
    703ac34 View commit details
    Browse the repository at this point in the history
  2. Merge pull request stleary#1067 from mechko/1063-biginteger-exponent-dos

    stleary#1063: bound BigDecimal→BigInteger expansion in objectToBigInteger (completes CVE-2026-59171 fix)
    stleary authored Jul 16, 2026
    Configuration menu
    Copy the full SHA
    a28328c View commit details
    Browse the repository at this point in the history
  3. max-number-length-config sonarqube fixes

    Sean Leary Sean Leary
    Sean Leary authored and Sean Leary committed Jul 16, 2026
    Configuration menu
    Copy the full SHA
    9953b76 View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2026

  1. Merge pull request stleary#1068 from stleary/max-number-length-config

    Max number length config for BigInteger and BigDecimal
    stleary authored Jul 19, 2026
    Configuration menu
    Copy the full SHA
    80efb52 View commit details
    Browse the repository at this point in the history
  2. pre-release-20260719 initial commit

    Sean Leary Sean Leary
    Sean Leary authored and Sean Leary committed Jul 19, 2026
    Configuration menu
    Copy the full SHA
    d24bc9e View commit details
    Browse the repository at this point in the history
  3. pre-release-20260719 oops forgot to update new unit tests for strict …

    …mode
    Sean Leary Sean Leary
    Sean Leary authored and Sean Leary committed Jul 19, 2026
    Configuration menu
    Copy the full SHA
    da757c6 View commit details
    Browse the repository at this point in the history
  4. Merge pull request stleary#1069 from stleary/pre-release-20260719

    20260719 prep for next release
    stleary authored Jul 19, 2026
    Configuration menu
    Copy the full SHA
    1795e8c View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2026

  1. Fix XML.unescape rejecting valid whitespace numeric character references

    XML.mustEscape() is shared by both XML.escape() (serialization) and
    XMLTokener.unescapeEntity() (deserialization). While the method's Javadoc
    and comment quote the W3C XML 1.0 valid-character range
    (#x9 | #xA | #xD | [#x20-#xD7FF] | ...), the implementation only checked
    [#x20-#xD7FF] in its range clause, omitting #x9/#xA/#xD.
    
    Although the ISO-control clause excluded those three codepoints, the
    negated range clause still marked them as 'must escape', so unescapeEntity()
    threw JSONException for the XML-allowed control characters TAB, LF and CR.
    
    This broke XML.unescape("&stleary#10;") and XML.toJSONObject("<a>&stleary#10;</a>"),
    both of which worked in v20251224 and regressed after stleary#1045 (v20260522).
    
    Align the range clause with the W3C spec by explicitly allowing #x9, #xA
    and #xD, matching the comment that was already documented.
    
    Fixes stleary#1059
    dong0713 committed Jul 20, 2026
    Configuration menu
    Copy the full SHA
    94854a1 View commit details
    Browse the repository at this point in the history

Commits on Jul 23, 2026

  1. stleary#1071: reject invalid XML element names in XML.toString (CWE-91)

    XML.toString emitted JSONObject keys verbatim as tag names, so a key
    containing '<', '>' or '/' broke out of its element and injected
    arbitrary sibling structure into the output. Per stleary#294/stleary#123 the agreed
    approach is to throw on invalid input rather than mangle it.
    
    - Add mustBeXmlName / isXmlNameStart / isXmlNameChar implementing the
      XML 1.0 (5th ed.) Name production, code-point aware.
    - Validate tagName at method entry and each key at the top of the key
      loop (skipping the cDataTagName sentinel).
    - Rewrite XMLTest.shouldHandleIllegalJSONNodeNames and
      XMLConfigurationTest.shouldHandleIllegalJSONNodeNames (previously
      documenting the pass-through behaviour) to assert the throw.
    - Add XMLTest.toStringRejectsElementInjectionInKey covering the stleary#1071
      payload and an invalid caller-supplied tagName.
    - Add XMLTest.toStringAcceptsValidXmlNames covering hyphen/dot/
      underscore/colon, Latin-1 letters, and the cDataTagName sentinel.
    
    Fixes stleary#1071. Also resolves the long-standing well-formedness question
    in stleary#166 / stleary#294 / stleary#308.
    
    Co-Authored-By: Claude <noreply@anthropic.com>
    mechko and claude committed Jul 23, 2026
    Configuration menu
    Copy the full SHA
    e2cfb5a View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2026

  1. stleary#1071: extract inRange helper to satisfy Sonar S3776

    isXmlNameStart's alternating &&/|| chain scored cognitive complexity 28.
    Extracting inRange(cp, lo, hi) collapses it to a flat || sequence and
    keeps the range list 1:1 with the XML 1.0 NameStartChar production.
    isXmlNameChar updated the same way. No behaviour change.
    
    Co-Authored-By: Claude <noreply@anthropic.com>
    mechko and claude committed Jul 24, 2026
    Configuration menu
    Copy the full SHA
    6b993e2 View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2026

  1. Merge pull request stleary#1070 from dong0713/fix/xml-unescape-whites…

    …pace-control-chars
    
    Fix XML.unescape rejecting valid whitespace numeric character references
    stleary authored Jul 29, 2026
    Configuration menu
    Copy the full SHA
    b594a32 View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2026

  1. Configuration menu
    Copy the full SHA
    392a352 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    22ab2fb View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2026

  1. pre-release-20260814 initial commit

    Sean Leary Sean Leary
    Sean Leary authored and Sean Leary committed Aug 14, 2026
    Configuration menu
    Copy the full SHA
    34efda6 View commit details
    Browse the repository at this point in the history
  2. Merge pull request stleary#1073 from stleary/pre-release-20260814

    20260814 prep for next release
    stleary authored Aug 14, 2026
    Configuration menu
    Copy the full SHA
    6c14048 View commit details
    Browse the repository at this point in the history

Commits on Aug 20, 2026

  1. stleary#1071: narrow tag-name check to XML metachars only

    Per review on stleary#1072: reject only < > & " ' / in element names to
    close the CWE-91 injection vector, and drop the full XML 1.0 Name
    validation to preserve backwards compatibility for callers that
    emit non-well-formed but non-injecting tag names.
    
    Co-Authored-By: Claude <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01MTGnYg5v1QxaqqfDKHKTVr
    mechko and claude committed Aug 20, 2026
    Configuration menu
    Copy the full SHA
    3dd0ec0 View commit details
    Browse the repository at this point in the history

Commits on Aug 24, 2026

  1. Merge pull request stleary#1072 from mechko/1071-xml-tostring-name-va…

    …lidation
    
    stleary#1071: reject invalid XML element names in XML.toString (CWE-91)
    stleary authored Aug 24, 2026
    Configuration menu
    Copy the full SHA
    4f859fd View commit details
    Browse the repository at this point in the history
Loading